ScriptNoob Posted January 21, 2009 Posted January 21, 2009 I am just trying to create a dropdown that has options inside of it but for each of these options have different values. For example the dropdown would say "Orlando" but the value would be orlando.server1.com and I would want this stored in a variable. I know how to create the dropdown and variables but im not sure how to assign the alternate value to the combobox elements. Any help is appreciated.
Moderators Melba23 Posted January 21, 2009 Moderators Posted January 21, 2009 ScriptNoob, The simplest way would be to get a value in the combo box, then use GUICtrlRead in a Select Case. Something like this:#include <GUIConstantsEx.au3> GUICreate("Test",200,300) GUICtrlCreateLabel("Please select your nearest office",3,8) $n1=GUICtrlCreateList ("", 45,35,100,220 ) GUICtrlSetData(-1,"Basingstoke|Sunderland|Aberdeen", "Aberdeen") $n2=GUICtrlCreateButton ("Start",50, 260, 80, 30) GUICtrlSetState(-1,$GUI_FOCUS); the focus is on this button GUISetState() ; Get location While 1 $msg = GUIGetMsg() If $msg = $n2 Then Select case GUICtrlRead($n1) = "Basingstoke" $Server = "\\basiserver\Software" case GUICtrlRead($n1) = "Sunderland" $Server = "\\sundserver\Software" case GUICtrlRead($n1) = "Aberdeen" $Server = "\\aberserver\Software" EndSelect ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then Exit EndIf WEnd ConsoleWrite($Server & "\Install\Setup.exe" & @CRLF) Hope this helps, M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ScriptNoob Posted January 21, 2009 Author Posted January 21, 2009 I might be able to work with this, it seems like the syntax I need. Thank you much M23
ScriptNoob Posted January 21, 2009 Author Posted January 21, 2009 It's going to work , thanks again =)
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