Как задать отступы в TextBox
Private Declare Function SendMessage Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long,
ByVal lParam As Long) As Long
Private Const EM_SETMARGINS = &HD3
Private Const EC_LEFTMARGIN = &H1
Private Const EC_RIGHTMARGIN = &H2
' Set the TextBox's margins.
Private Sub SetMargin(nLeft As Integer, nRight As Integer, lhWnd As Long)
Dim lLongValue As Long
'необходимо, чтобы nRight была в старшем
слове, поэтому умножаем на 65536
lLongValue = 65536 * nRight + nLeft
SendMessage lhWnd, EM_SETMARGINS, _
EC_LEFTMARGIN Or EC_RIGHTMARGIN, lLongValue
End Sub
|