UDF > GUI > GuiListBox >


_GUICtrlListBox_Destroy

Supprime le contrôle

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

Paramètre

$hWnd ID/handle du contrôle

Valeur de retour

Succès: Retourne True, $hWnd est défini à 0.
Échec: Retourne False.

Remarque

Réservé uniquement aux contrôles Listbox créés avec _GUICtrlListBox_Create().

En relation

_GUICtrlListBox_Create

Exemple

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

Example()

Func Example()
    Local $hGUI, $hListBox

    ; Crée une GUI
    $hGUI = GUICreate("(UDF Created) List Box Destroy", 400, 296)
    $hListBox = _GUICtrlListBox_Create($hGUI, "", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Ajoute des fichiers
    _GUICtrlListBox_BeginUpdate($hListBox)
    _GUICtrlListBox_ResetContent($hListBox)
    _GUICtrlListBox_InitStorage($hListBox, 100, 4096)
    _GUICtrlListBox_Dir($hListBox, @WindowsDir & "\win*.exe")
    _GUICtrlListBox_AddFile($hListBox, @WindowsDir & "\notepad.exe")
    _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES)
    _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES, False)
    _GUICtrlListBox_EndUpdate($hListBox)

    MsgBox($MB_SYSTEMMODAL, "Information", "Destruction de la ListBox")
    _GUICtrlListBox_Destroy($hListBox)

    ; Boucle jusqu'à ce que l'utilisateur quitte.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example