GoronSlayer99 Posted December 4, 2005 Posted December 4, 2005 Hey, Well... I want to have this ComboBox, with a button below it. I want it so that the button is the "excecute" button. Depending on what is selected in the ComboBox, a file will open... I looked around and found how to do it with buttons, but while attempting to apply it with a ComboBox, I failed. (I did look at the topic below, but it didn't appear to have my answer) #include <GUIConstants.au3> $Form1 = GUICreate("Select File", 240, 150, 0, 0) $Button1 = GUICtrlCreateButton("Run File", 75, 80, 75, 25) $Combo1 = GUICtrlCreateCombo("", 32, 24, 145, 21) GUICtrlSetData(-1, "Doc1|Doc2|Doc3|Doc4|Doc5|Doc6","Doc1") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ; EndSelect WEnd Exit So pretty much, I want each selection in the ComboBox to have it's own designated file path, and when the excecute button is clicked, the file will open. ---Thanks DiveHigh 1
Valuater Posted December 4, 2005 Posted December 4, 2005 maybe like this #include <GUIConstants.au3> $Form1 = GUICreate("Select File", 240, 150, 0, 0) $Button1 = GUICtrlCreateButton("Run File", 75, 80, 75, 25) $Combo1 = GUICtrlCreateCombo("", 32, 24, 145, 21) GUICtrlSetData(-1, "Doc1|Doc2|Doc3|Doc4|Doc5|Doc6","Doc1") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 $doc = GUICtrlRead($Combo1) if $doc = "Doc1" then Run("notepad.exe") ; if.... bla... bla ; EndSelect WEnd Exit 8) DiveHigh 1
GoronSlayer99 Posted December 4, 2005 Author Posted December 4, 2005 Yeah, that works perfectly, thanks man.
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