Option Explicit
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 WM_VSCROLL = &H115
Private Const SB_PAGEDOWN = 3
Private Sub Form_DblClick()
SendMessage Text1.hwnd, WM_VSCROLL, SB_PAGEDOWN, 0
End Sub
Private Sub Form_Load()
Text1.Text = _
"The quick brown fox jumps over a lazy dog" & vbCrLf & _
"Pack my box with five dozen liquor jugs" & vbCrLf & _
"Jackdaws love my big sphinx of quartz" & vbCrLf & _
"The five boxing wizards jump quickly" & vbCrLf & _
"Sphinx of black quartz, judge my vow" & vbCrLf & _
"Quick zephyrs blow, vexing daft Jim" & vbCrLf & _
"How quickly daft jumping zebras vex" & vbCrLf & _
"The quick brown fox jumps over a lazy dog" & vbCrLf & _
"Pack my box with five dozen liquor jugs" & vbCrLf & _
"Jackdaws love my big sphinx of quartz" & vbCrLf & _
"The five boxing wizards jump quickly" & vbCrLf & _
"Sphinx of black quartz, judge my vow" & vbCrLf & _
"Quick zephyrs blow, vexing daft Jim" & vbCrLf & _
"How quickly daft jumping zebras vex" & vbCrLf & _
"The quick brown fox jumps over a lazy dog" & vbCrLf & _
"Pack my box with five dozen liquor jugs" & vbCrLf & _
"Jackdaws love my big sphinx of quartz" & vbCrLf & _
"The five boxing wizards jump quickly" & vbCrLf & _
"Sphinx of black quartz, judge my vow" & vbCrLf & _
"Quick zephyrs blow, vexing daft Jim" & vbCrLf & _
"How quickly daft jumping zebras vex"
End Sub
Все, что тебе понадобится:MSDN писал(а):WM_VSCROLL
The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
WM_VSCROLL
nScrollCode = (int) LOWORD(wParam); // scroll bar value
nPos = (short int) HIWORD(wParam); // scroll box position
hwndScrollBar = (HWND) lParam; // handle to scroll bar
Parameters
nScrollCode
Value of the low-order word of wParam. Specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values: Value Meaning
SB_BOTTOM Scrolls to the lower right.
SB_ENDSCROLL Ends scroll.
SB_LINEDOWN Scrolls one line down.
SB_LINEUP Scrolls one line up.
SB_PAGEDOWN Scrolls one page down.
SB_PAGEUP Scrolls one page up.
SB_THUMBPOSITION The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The nPos parameter indicates the position that the scroll box has been dragged to.
SB_TOP Scrolls to the upper left.
nPos
Value of the high-order word of wParam. Specifies the current position of the scroll box if the nScrollCode parameter is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, nPos is not used.
hwndScrollBar
Value of lParam. If the message is sent by a scroll bar, then hwndScrollBar is the handle to the scroll bar control. If the message is not sent by a scroll bar, hwndScrollBar is NULL.
Return Value
If an application processes this message, it should return zero.
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Const WM_VSCROLL As Long = &H115
Private Const SB_BOTTOM As Long = 7
Private Const SB_ENDSCROLL As Long = 8
Private Const SB_LINEDOWN As Long = 1
Private Const SB_LINELEFT As Long = 0
Private Const SB_LINERIGHT As Long = 1
Private Const SB_LINEUP As Long = 0
Private Const SB_PAGEDOWN As Long = 3
Private Const SB_PAGELEFT As Long = 2
Private Const SB_PAGERIGHT As Long = 3
Private Const SB_PAGEUP As Long = 2
Private Const SB_THUMBPOSITION As Long = 4
Private Const SB_THUMBTRACK As Long = 5
Private Const SB_TOP As Long = 6
Private Const SB_VERT As Long = 1
Private Const SB_HORZ As Long = 0
Сейчас этот форум просматривают: Yandex-бот и гости: 27