Ajoute une chaîne à la liste déroulante d'une ComboBox
#include <GuiComboBox.au3>
_GUICtrlComboBox_AddString ( $hWnd, $sText )
$hWnd | ID/handle du contrôle |
$sText | Chaîne à ajouter |
Succès: | Retourne l'index du nouvel élément. |
Échec: | Retourne -1. |
_GUICtrlComboBox_DeleteString, _GUICtrlComboBox_InitStorage, _GUICtrlComboBox_InsertString, _GUICtrlComboBox_ResetContent
#include <GuiComboBox.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idCombo ; Crée une GUI GUICreate("ComboBox Add String", 400, 296) $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState(@SW_SHOW) ; Ajoute des fichiers _GUICtrlComboBox_AddDir($idCombo, "", $DDL_DRIVES, False) ; Ajoute une chaîne _GUICtrlComboBox_AddString($idCombo, "This string has been added") ; Boucle jusqu'à ce que l'utilisateur quitte Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example