UDF > GUI > GuiComboBox >


_GUICtrlComboBox_ResetContent

Retire tous les éléments de la ListBox et modifie le contrôle ComboBox

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

Paramètre

$hWnd ID/handle du contrôle

Valeur de retour

Aucune.

En relation

_GUICtrlComboBox_AddString, _GUICtrlComboBox_DeleteString

Exemple

#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    Local $idCombo

    ; Crée une GUI
    GUICreate("ComboBox Reset Content", 400, 296)
    $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296, BitOR($CBS_SIMPLE, $CBS_DISABLENOSCROLL, $WS_VSCROLL))
    GUISetState(@SW_SHOW)

    ; Définit Edit Text
    _GUICtrlComboBox_SetEditText($idCombo, "Edit Text")

    ; Ajoute des fichiers
    _GUICtrlComboBox_BeginUpdate($idCombo)
    _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($idCombo)

    Sleep(500)

    ; Ré-initialise le contenu
    _GUICtrlComboBox_ResetContent($idCombo)

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