dude101 Posted May 24, 2010 Share Posted May 24, 2010 Hello all, Im new to the software and this site. I think it is awesome lol. Ive been reading the help document all day. However I have a question. I am trying to have a drop down box with a list of lets say 10 options. When the user selects from the drop down box, Whatever is selected is passed into IE and is used as the keyword in google. I have everything else down except setting up the drop down box and passing it to google. Any ideas on how to do this? Please and Thanks. Link to comment Share on other sites More sharing options...
Makaule Posted May 24, 2010 Share Posted May 24, 2010 (edited) You could use GUICtrlCreateCombo, to create drop down selection. To read selected data from combo box you could just call GuiCtrlRead and save it to some variable. For example:#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $hwnd = GUICreate ("Web Browser", 200, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $combo = GUICtrlCreateCombo("", 5, 5, 100, 20) GUICtrlSetData(-1, "item1|item2|item3", "item1") GUICtrlSetOnEvent($combo, "_Selected") GUISetState(@SW_SHOW) While 1 Sleep(50) WEnd Func _Selected() $Selection = GuiCtrlRead($combo) MsgBox(0, "Selection...", "Selected item: " & $Selection) EndFunc Func _Exit() Exit EndFunc Edited May 24, 2010 by Makaule Link to comment Share on other sites More sharing options...
dude101 Posted May 24, 2010 Author Share Posted May 24, 2010 You could use GUICtrlCreateCombo, to create drop down selection. To read selected data from combo box you could just call GuiCtrlRead and save it to some variable. For example: #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $hwnd = GUICreate ("Web Browser", 200, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $combo = GUICtrlCreateCombo("", 5, 5, 100, 20) GUICtrlSetData(-1, "item1|item2|item3", "item1") GUICtrlSetOnEvent($combo, "_Selected") GUISetState(@SW_SHOW) While 1 Sleep(50) WEnd Func _Selected() $Selection = GuiCtrlRead($combo) MsgBox(0, "Selection...", "Selected item: " & $Selection) EndFunc Func _Exit() Exit EndFunc Thanks for the response. In my code I had _IENavigate($oIE,"http://resultfromdropdown.somesite.com/?q="something") oIE is an embedded window. My question is how would i place the result returned from the dropdown to replace "resultfromdropdown Link to comment Share on other sites More sharing options...
Makaule Posted May 24, 2010 Share Posted May 24, 2010 Try this, if you change item1, item2, item3 to normal adresses, like http://www.google.com: Func _Selected() $Selection = GuiCtrlRead($combo) _IENavigate($oIE, $Selection) EndFunc or this, if you want to surf on same website, just different place, lets say place1.htm, place2.htm and etc.: Func _Selected() $Selection = "http://www.something.com/" & GuiCtrlRead($combo) _IENavigate($oIE, $Selection) EndFunc 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