Merchants Posted August 12, 2010 Posted August 12, 2010 (edited) GUICtrlSetData($GUI[1], "item2|item3", "item3") ; add other item snd set a new default and how to remove item 2 ? so that item1 and 3 remains in the combobox.. #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $GUI[10] $GUI[0] = GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered $GUI[1] = GUICtrlCreateCombo("item1", 10, 10) ; create first item GUICtrlSetData($GUI[1], "item2|item3", "item3") ; add other item snd set a new default GUISetState() ; Run the GUI until the dialog is closed While 1 $GUI[2] = GUIGetMsg() Select Case $GUI[2] = $GUI_EVENT_CLOSE Exit Case $GUI[2] = $GUI[1] MsgBox(64,"test",GUICtrlRead($GUI[1])) EndSelect WEnd EndFunc ;==>Example Edited August 12, 2010 by Merchants
FlyinRiz Posted August 12, 2010 Posted August 12, 2010 (edited) GUICtrlSetData($GUI[1], "item1|item3", "item3") -Aaron Edited August 12, 2010 by FlyinRiz
Merchants Posted August 12, 2010 Author Posted August 12, 2010 (edited) GUICtrlSetData($GUI[1], "item1|item3", "item3") -Aaron already tried then it wil ADD item1 and item3 again.. so then you get 5 items Edited August 12, 2010 by Merchants
Habland0 Posted August 12, 2010 Posted August 12, 2010 (edited) #Include <GuiComboBox.au3> _GUICtrlComboBox_DeleteString($GUI[1], 1) ; Remove item 2 Edited August 12, 2010 by Habland0
Developers Jos Posted August 12, 2010 Developers Posted August 12, 2010 Need to start the literal string with "|" or else its added. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
FlyinRiz Posted August 12, 2010 Posted August 12, 2010 Need to start the literal string with "|" or else its added. RemarksFor Combo or List control :If the "data" corresponds to an already existing entry it is set as the default.If the "data" starts with GUIDataSeparatorChar or is an empty string "" the previous list is destroyed.Good call!
Merchants Posted August 12, 2010 Author Posted August 12, 2010 wel i have used: _GUICtrlComboBox_DeleteString(control, index)
Habland0 Posted August 12, 2010 Posted August 12, 2010 wel i have used: _GUICtrlComboBox_DeleteString(control, index)
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