Remplace le texte sélectionné dans la boîte d'édition
#include <GuiComboBox.au3>
_GUICtrlComboBox_ReplaceEditSel ( $hWnd, $sText )
$hWnd | ID/handle du contrôle |
$sText | Chaîne contenant le texte de remplacement |
Si le message est envoyé à une zone de liste déroulante avec le style $CBS_DROPDOWN ou $CBS_DROPDOWNLIST, la fonction échouera.
_GUICtrlComboBox_SetEditSel, _GUICtrlComboBox_SetEditText
#include <GuiComboBox.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $idCombo ; Crée une GUI GUICreate("ComboBox Replace Edit Sel", 400, 296) $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState(@SW_SHOW) ; Définit Edit Text _GUICtrlComboBox_SetEditText($idCombo, "Old Edit Text") ; Ajoute des fichiers _GUICtrlComboBox_BeginUpdate($idCombo) _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe") _GUICtrlComboBox_EndUpdate($idCombo) Sleep(500) ; Sélectionne du texte dans la boîte d'édition _GUICtrlComboBox_SetEditSel($idCombo, 0, -1) Sleep(500) ; Remplace le texte dans la boîte d'édition _GUICtrlComboBox_ReplaceEditSel($idCombo, "New Edit Text") ; Boucle jusqu'à ce que l'utilisateur quitte Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example