Bodman Posted August 28, 2009 Share Posted August 28, 2009 Hi, Im trying to create a drop down menu from a set of variables that I am pulling from a ini file. I can do this no problem if I used fixed txt names but from variables they all list in one line. Any help greatly appreciated. #include <GuiConstants.au3> ;Read sites and URL's from ini file $site1 = IniRead("ecap.ini", "Sites", "Site1", "NotFound") $URL1 = IniRead("ecap.ini", "Sites", "URL1", "NotFound") $site2 = IniRead("ecap.ini", "Sites", "Site2", "NotFound") $URL2 = IniRead("ecap.ini", "Sites", "URL2", "NotFound") ;Create Menu $GUI_Handle = GuiCreate("Ecap", 199, 41,(@DesktopWidth-199)/2, (@DesktopHeight-41)/2) $Combo_1 = GUICtrlCreateCombo("Select", 10, 10, 140, 21) GUICtrlSetData($Combo_1 , $site1 & $site2 & "|Site 3|Site 4|Site 5|Site 6|Site 7|Site 9|Site 10|Site 11|Site 12|","Select") $Button_2 = GuiCtrlCreateButton("OK", 160, 10, 30, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button_2 GUICtrlRead($Combo_1) $Menustate = GUICtrlRead($Combo_1) MsgBox(4096, "Result", $Menustate) If $menustate = ("Belfast") Then run( "notepad.exe","") EndSelect WEnd Link to comment Share on other sites More sharing options...
jvanegmond Posted August 28, 2009 Share Posted August 28, 2009 You forgot the |. GUICtrlSetData($Combo_1 , $site1 & "|" & $site2 & "|Site 3|Site 4|Site 5|Site 6|Site 7|Site 9|Site 10|Site 11|Site 12|","Select") github.com/jvanegmond Link to comment Share on other sites More sharing options...
Bodman Posted August 28, 2009 Author Share Posted August 28, 2009 You forgot the |. GUICtrlSetData($Combo_1 , $site1 & "|" & $site2 & "|Site 3|Site 4|Site 5|Site 6|Site 7|Site 9|Site 10|Site 11|Site 12|","Select") Thank you. I have tried so many combinations and just couldn't find it //Bod 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