Function Reference


_GUICtrlListView_Scroll

Scrolls the content of a list-view

#include <GuiListView.au3>
_GUICtrlListView_Scroll ( $hWnd, $iDX, $iDY )

Parameters

$hWnd Control ID/Handle to the control
$iDX 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.
$iDY Value of type int that specifies the amount of vertical scrolling in pixels

Return Value

Success: True.
Failure: False.

Remarks

When the list-view control is in report view, the control can only be scrolled vertically in whole line increments.
Therefore, the $iDY 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 $iDY, the list will be scrolled by 16 pixels (1 line).
If 7 is passed for $iDY, the list will be scrolled 0 pixels (0 lines).

Example

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

Example()

Func Example()
        Local $idListview

        GUICreate("ListView Scroll", 400, 300)
        $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        ; Add column
        _GUICtrlListView_AddColumn($idListview, "Items", 100)

        ; Add items
        _GUICtrlListView_BeginUpdate($idListview)
        For $iI = 1 To 100
                _GUICtrlListView_AddItem($idListview, "Item " & $iI)
        Next
        _GUICtrlListView_EndUpdate($idListview)

        ; Scroll control 500 pixels
        _GUICtrlListView_Scroll($idListview, 0, 500)

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>Example