gcue Posted January 15, 2009 Share 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, "") Link to comment Share on other sites More sharing options...
rasim Posted January 15, 2009 Share 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 Link to comment Share on other sites More sharing options...
gcue Posted January 15, 2009 Author Share Posted January 15, 2009 thanks! Link to comment Share on other sites More sharing options...
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