I think he is talking about using it on a text box or something. I think you would have to use SendMessage to do that.
Printable View
I think he is talking about using it on a text box or something. I think you would have to use SendMessage to do that.
Put a textbox and a commandbutton onto a form. Then add this code:
Code:Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const EM_SCROLL = &HB5
Const SB_LINEDOWN = 1
Const SB_LINEUP = 0
Const SB_PAGEDOWN = 3
Const SB_PAGEUP = 2
Private Sub Command1_Click()
SendMessage Text1.hwnd, EM_SCROLL, SB_LINEDOWN, 0
End Sub
Private Sub Form_Load()
For i = 1 To 50
Text1.Text = Text1.Text + vbCrLf + "here is some particularly useful text being used as an example."
Next i
End Sub
And here's how you'd do that...
I haven't tested it, but I'm pretty sure it'll work.Code:Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _ Long, ByVal wParam As Long, lParam As Any) As Long
Private Const SB_LINEDOWN = 1
Private Const SB_LINEUP = 0
Private Const EM_SCROLL = &HB5
Private Sub cmdScrollUp_Click()
Call SendMessage(Text1.hWnd, EM_SCROLL, SB_LINEUP, 0)
End Sub
Private Sub cmdScrollDown_Click()
Call SendMessage(Text1.hWnd, EM_SCROLL, SB_LINEUP, 0)
End Sub
Le one and only moi.
That's the second time you've beaten me to it in this thread...
Grrrr.
I'll have to neutralise the threat.
I know where you live...almost
I will try those tips. Thanks alot everyone!!!