Article ID: 161270
Article Last Modified on 7/1/2004
SendMessage(hWnd, EM_LINESCROLL, wParam, lParam) where:
Const EM_LINESCROLL = &HB6
Private Declare Function SendMessage Lib "User32" Alias _
"SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Long) As Long
Private Sub Form_Load()
Dim intLineIndex As Integer, intWordIndex As Integer
'Initialize Text1.
Text1.Font = "Courier New"
Text1.Text = ""
For intLineIndex = 1 To 25 'Add 25 lines of text.
Text1.Text = Text1.Text & "Line" & Str$(intLineIndex)
For intWordIndex = 1 To 5 'Make each line 12 words
'long.
Text1.Text = Text1.Text & " Word" & Str$(intWordIndex)
Next intWordIndex
Text1.Text = Text1.Text & vbCrLf
Next intLineIndex
Command1.Caption = "Vertical"
Command2.Caption = "Horizontal"
End Sub
Private Sub Command1_Click()
Dim lngRet As Long
lngRet = SendMessage(Text1.hWnd, EM_LINESCROLL, 0, 5&)
End Sub
Private Sub Command2_Click()
Dim lngRet As Long
lngRet = SendMessage(Text1.hWnd, EM_LINESCROLL, 5, 0&)
End Sub
Keywords: kbhowto KB161270