J
Juan Romero
Guys,
Does anyone know how to set a RichTextControl Left Margin?
I tried using the API but it is not working. I must be doing something
wrong. Here is my code:
Private Const EC_LEFTMARGIN = &H1
Private Const EC_RIGHTMARGIN = &H2
Private Const EC_USEFONTINFO = &HFFFF&
Private Const EM_SETMARGINS = &HD3&
Private Const EM_GETMARGINS = &HD4&
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA"
(ByVal hwnd As IntPtr, ByVal wMsg As Long, ByVal wParam As Long, ByVal
lParam As Long) As Long
Private Sub SetLeftMargin(ByVal lhWnd As IntPtr, ByVal lMargin As Long)
Dim lLongValue As Long
Dim Result As Long
Result = SendMessageLong(lhWnd, EM_SETMARGINS, EC_LEFTMARGIN,
lMargin)
End Sub
The call to the function is:
SetLeftMargin(Me.Handle, 100) 'Me = Richtextbox control
Any ideas?
Thanks!
Does anyone know how to set a RichTextControl Left Margin?
I tried using the API but it is not working. I must be doing something
wrong. Here is my code:
Private Const EC_LEFTMARGIN = &H1
Private Const EC_RIGHTMARGIN = &H2
Private Const EC_USEFONTINFO = &HFFFF&
Private Const EM_SETMARGINS = &HD3&
Private Const EM_GETMARGINS = &HD4&
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA"
(ByVal hwnd As IntPtr, ByVal wMsg As Long, ByVal wParam As Long, ByVal
lParam As Long) As Long
Private Sub SetLeftMargin(ByVal lhWnd As IntPtr, ByVal lMargin As Long)
Dim lLongValue As Long
Dim Result As Long
Result = SendMessageLong(lhWnd, EM_SETMARGINS, EC_LEFTMARGIN,
lMargin)
End Sub
The call to the function is:
SetLeftMargin(Me.Handle, 100) 'Me = Richtextbox control
Any ideas?
Thanks!