Funktionreferenz


_GUICtrlComboBox_ResetContent

Beschreibung anzeigen in

Löscht alle Items in einer ListBox und einem Edit-Control einer ComboBox

#include <GuiComboBox.au3>
_GUICtrlComboBox_ResetContent ( $hWnd )

Parameter

$hWnd Control-ID / Handle des Controls

Rückgabewert

Keine.

Bemerkungen

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

Verwandte Funktionen

_GUICtrlComboBox_AddString, _GUICtrlComboBox_DeleteString

Beispiel

#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    Local $idCombo

    ; Erstellt eine GUI
    GUICreate("ComboBox: Löscht alle Items", 400, 296)
    $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296, BitOR($CBS_SIMPLE, $CBS_DISABLENOSCROLL, $WS_VSCROLL))
    GUISetState(@SW_SHOW)

    ; Setzt den Text des Edit-Controls
    _GUICtrlComboBox_SetEditText($idCombo, "Text des Edit-Controls")

    ; Fügt Dateien hinzu
    _GUICtrlComboBox_BeginUpdate($idCombo)
    _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($idCombo)

    Sleep(500)

    ; Löscht alle Items
    _GUICtrlComboBox_ResetContent($idCombo)

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