Löscht alle Items in einer ListBox und einem Edit-Control einer ComboBox
#include <GuiComboBox.au3>
_GUICtrlComboBox_ResetContent ( $hWnd )
$hWnd | Control-ID / Handle des Controls |
- - - - - - - - Erklärung der Controls - - - - - - - -
_GUICtrlComboBox_AddString, _GUICtrlComboBox_DeleteString
#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