Function Reference

_GUICtrlListClear

Remove all items from the list box

#Include <GuiList.au3>
_GUICtrlListClear($h_listbox)

 

Parameters

$h_listbox control id/control hWnd

 

Return Value

None.

 

Remarks

None.

 

Related

_GUICtrlListDeleteItem, _GUICtrlListAddItem, _GUICtrlListInsertItem

 

Example


#include <GUIConstants.au3>
#include <GuiList.au3>

Opt ('MustDeclareVars', 1)

Dim $msg, $ret
Dim $listbox, $button

GUICreate("ListBox Clear All Items Demo", 400, 250, -1, -1)

$listbox = GUICtrlCreateList("", 125, 40, 180, 120)
GUICtrlSetData($listbox, "test1|test2|test3|")
$button = GUICtrlCreateButton("Clear All", 150, 160, 120, 40)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $button
            _GUICtrlListClear ($listbox)
    EndSelect
WEnd