UDF > GUI > GuiListView >


_GUICtrlListView_Destroy

Supprime le contrôle ListView

#include <GuiListView.au3>
_GUICtrlListView_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

Cette fonction est réservée aux contrôles ListView créés avec _GUICtrlListView_Create().

En relation

_GUICtrlListView_Create

Exemple

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

Example()

Func Example()
    Local $hGUI, $hHandleBefore, $hListView

    $hGUI = GUICreate("(UDF Created) ListView Destroy", 400, 300)

    $hListView = _GUICtrlListView_Create($hGUI, "", 2, 2, 394, 268)
    $hHandleBefore = $hListView
    GUISetState(@SW_SHOW)

    ; Ajoute des colonnes
    _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
    _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
    _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

    ; Ajoute des éléments
    _GUICtrlListView_AddItem($hListView, "Row 1: Col 1")
    _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($hListView, "Row 2: Col 1")
    _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($hListView, "Row 3: Col 1")

    MsgBox($MB_SYSTEMMODAL, "Information", "Destroying the Control for Handle: " & $hListView)
    MsgBox($MB_SYSTEMMODAL, "Information", "Control Destroyed: " & _GUICtrlListView_Destroy($hListView) & @CRLF & _
            "Handel Before Destroy: " & $hHandleBefore & @CRLF & _
            "Handle After Destroy: " & $hListView)

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

    GUIDelete()
EndFunc   ;==>Example