Alexanbar » 31.08.2004 (Вт) 21:08
Отсылкой сообщения LVM_SCROLL с помощью ф-ции SendMessage
Public Const LVM_SCROLL = 4116
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Вот что пишут в Microsoft:Scrolls the content of a list-view control. You can send this message explicitly or by using the ListView_Scroll macro.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) LVM_SCROLL, // message ID (WPARAM) wParam, // = (WPARAM) (int) dx; (LPARAM) lParam // = (LPARAM) (int) dy; );
Parameters
dx
Value of type int that specifies the amount of horizontal scrolling in pixels. If the list-view control is in list-view, this value specifies the number of columns to scroll.
dy
Value of type int that specifies the amount of vertical scrolling in pixels.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
When the list-view control is in report view, the control can only be scrolled vertically in whole line increments. Therefore, the dy parameter will be rounded to the nearest number of pixels that form a whole line increment. For example, if the height of a line is 16 pixels and 8 is passed for dy, the list will be scrolled by 16 pixels (1 line). If 7 is passed for dy, the list will be scrolled 0 pixels (0 lines).