Function Reference


_GUICtrlListBox_ClickItem

Clicks an item

#include <GuiListBox.au3>
_GUICtrlListBox_ClickItem ( $hWnd, $iIndex [, $sButton = "left" [, $bMove = False [, $iClicks = 1 [, $iSpeed = 0]]]] )

Parameters

$hWnd Control ID/Handle to the control
$iIndex Specifies the 0-based index of the item
$sButton [optional] Button to click with
$bMove [optional] If True, the mouse will be moved. If False, the mouse does not move.
$iClicks [optional] Number of clicks
$iSpeed [optional] Mouse movement speed

Return Value

None.

Example

#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>

Example()

Func Example()
    Local $idListBox

    ; Create GUI
    GUICreate("List Box Click Item_GUICtrlListBox_ClickItem", 400, 296)
    $idListBox = GUICtrlCreateList("", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Add strings
    _GUICtrlListBox_BeginUpdate($idListBox)
    For $iI = 1 To 9
        _GUICtrlListBox_AddString($idListBox, StringFormat("%03d : Random string", Random(1, 100, 1)))
    Next
    _GUICtrlListBox_EndUpdate($idListBox)

    ; Click an item
    _GUICtrlListBox_ClickItem($idListBox, 4, "left", True)

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