Bert Posted December 14, 2006 Share Posted December 14, 2006 This is hurting my head. I've spent lots of time reading the helpfile, and looking at examples...All I'm looking to do is have a list that I can add or take away from, and save that list in a ini. #include <GuiConstants.au3> #include <GuiCombo.au3> Opt('MustDeclareVars',1) Dim $Combo, $Btn_Delete, $Btn_Exit, $msg, $Btn_Add, $gg GuiCreate("ComboBox String", 392, 204) $Combo = GuiCtrlCreateCombo("", 70, 10, 270, 110,$CBS_SIMPLE) $Btn_Delete = GuiCtrlCreateButton("Delete String", 35, 120, 90, 30) $Btn_Add = GuiCtrlCreateButton("Add String", 145, 120, 90, 30) GUICtrlSetData($Combo,"B|C|D|E|F") $Btn_Exit = GuiCtrlCreateButton("Exit", 255, 120, 90, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_Delete If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then _GUICtrlComboDeleteString($Combo,_GUICtrlComboGetCurSel($Combo)) EndIf Case $msg = $Btn_Add If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then _GUICtrlComboAddString($Combo,$gg = _GUICtrlComboGetCurSel($Combo)) GUICtrlSetData($Combo,$gg) endif EndSelect WEnd Exit The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
GaryFrost Posted December 14, 2006 Share Posted December 14, 2006 #include <GuiConstants.au3> #include <GuiCombo.au3> Opt('MustDeclareVars',1) Dim $Combo, $Btn_Delete, $Btn_Exit, $msg, $Btn_Add, $gg GuiCreate("ComboBox String", 392, 204) $Combo = GuiCtrlCreateCombo("", 70, 10, 270, 110,$CBS_SIMPLE) $Btn_Delete = GuiCtrlCreateButton("Delete String", 35, 120, 90, 30) $Btn_Add = GuiCtrlCreateButton("Add String", 145, 120, 90, 30) GUICtrlSetData($Combo,"B|C|D|E|F") $Btn_Exit = GuiCtrlCreateButton("Exit", 255, 120, 90, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_Delete If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then _GUICtrlComboDeleteString($Combo,_GUICtrlComboGetCurSel($Combo)) EndIf Case $msg = $Btn_Add If GUICtrlRead($Combo) <> "" Then ConsoleWrite(_GUICtrlComboAddString($Combo,GUICtrlRead($Combo)) & @LF) ;~ If(_GUICtrlComboGetCurSel($Combo) <> $CB_ERR) Then ;~ _GUICtrlComboAddString($Combo,$gg = _GUICtrlComboGetCurSel($Combo)) ;~ GUICtrlSetData($Combo,$gg) ;~ endif EndSelect WEnd Exit SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Bert Posted December 14, 2006 Author Share Posted December 14, 2006 Thanks Gary! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted December 14, 2006 Author Share Posted December 14, 2006 I tested it, and It works great. I noticed it will duplicate entries, so I need to fix that. I tried to do a GUiCtrlRead so I can get a string, but it is only getting the data in the entry field. How do I get the list string? The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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