Funktionreferenz


_GUICtrlListBox_Destroy

Beschreibung anzeigen in

Löscht das Control (ListBox)

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

Parameter

$hWnd Control-ID / Handle des Controls

Rückgabewert

Erfolg: True, $hWnd wird auf 0 gesetzt
Fehler: False

Bemerkungen

Funktioniert nur mit einer Listbox-Controls, die mit _GUICtrlListBox_Create() erstellt wurde

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUICtrlListBox_Create

Beispiel

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

Example()

Func Example()
    Local $hGui, $hListBox

    ; Erstellt eine GUI
    $hGui = GUICreate("ListBox: Löschen (UDF)", 400, 296)
    $hListBox = _GUICtrlListBox_Create($hGui, "", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Fügt Dateien hinzu
    _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", "ListBox löschen")
    _GUICtrlListBox_Destroy($hListBox)

    ; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example