Function Reference


_GUICtrlListBox_Destroy

Delete the control

#include <GuiListBox.au3>
_GUICtrlListBox_Destroy ( ByRef $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Success: True, $hWnd is set to 0.
Failure: False.

Remarks

Restricted to only be used on Listbox controls created with _GUICtrlListBox_Create().

Related

_GUICtrlListBox_Create

Example

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

Example()

Func Example()
    Local $hGUI, $idListBox

    ; Create GUI
    $hGUI = GUICreate("(UDF Created) List Box Destroy", 400, 296)
    $idListBox = _GUICtrlListBox_Create($hGUI, "", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Add files
    _GUICtrlListBox_BeginUpdate($idListBox)
    _GUICtrlListBox_ResetContent($idListBox)
    _GUICtrlListBox_InitStorage($idListBox, 100, 4096)
    _GUICtrlListBox_Dir($idListBox, @WindowsDir & "\win*.exe")
    _GUICtrlListBox_AddFile($idListBox, @WindowsDir & "\notepad.exe")
    _GUICtrlListBox_Dir($idListBox, "", $DDL_DRIVES)
    _GUICtrlListBox_Dir($idListBox, "", $DDL_DRIVES, False)
    _GUICtrlListBox_EndUpdate($idListBox)

    MsgBox($MB_SYSTEMMODAL, "Information", "Destroying ListBox")
    _GUICtrlListBox_Destroy($idListBox)

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