gcue Posted January 15, 2009 Posted January 15, 2009 i have a combo that has data and i would like to blank the current selection but not the entire list i add to the combolist like this: GUICtrlSetData($c_IP, GUICtrlRead($c_IP)) but after adding id like to clear the last entry and make ready for the next entry so id like to blank the current entry without deleting the list i tried this but it clears the entire list: GUICtrlSetData($c_IP, "")
rasim Posted January 15, 2009 Posted January 15, 2009 Example: #Include <GuiConstantsEx.au3> #Include <GuiComboBox.au3> $hGUI = GUICreate("Test", 200, 100) $cCombobox = GUICtrlCreateCombo("", 11, 25, 180, 20) GUICtrlSetData(-1, "One|Two|Three", "One") $cButton_DelString = GUICtrlCreateButton("Delete", 60, 66, 75, 23) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $cButton_DelString _DelString($cCombobox) EndSwitch WEnd Func _DelString($cControl) Local $iIndex = _GUICtrlComboBox_GetCurSel($cCombobox) If $iIndex = -1 Then Return 0 If _GUICtrlComboBox_DeleteString($cControl, $iIndex) <> -1 Then _GUICtrlComboBox_SetCurSel($cControl, 0) Return 1 EndIf EndFunc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now