JetsterDajet Posted January 2, 2009 Share Posted January 2, 2009 I've been working on this for hours and I know I'm missing something simple. All I want it to do is to return the text selected in the combo. The script always returns the text defined in GuiCtrlCreateCombo and ignores any data set from the GUICtrlSetData. I know this is easy, your help is appreciated. #include <GUIConstantsEx.au3> GUICreate("Test", 500, 500) GUICtrlCreateLabel("test", 135, 10) $productlist = "product1|product2|product3" $product = GUICtrlCreateCombo("Select a Product", 210, 85, 150, 100) GUICtrlSetData(-1, $productlist) $dropit = GUICtrlCreateButton ( "Drop It!", 210, 420 , 90 , 20) $productget = GUICtrlRead($product) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $dropit ClipPut($productget) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Link to comment Share on other sites More sharing options...
Valuater Posted January 3, 2009 Share Posted January 3, 2009 Need to read the control AFTER the selections #include <GUIConstantsEx.au3> GUICreate("Test", 500, 500) GUICtrlCreateLabel("test", 135, 10) $productlist = "product1|product2|product3" $product = GUICtrlCreateCombo("Select a Product", 210, 85, 150, 100) GUICtrlSetData(-1, $productlist) $dropit = GUICtrlCreateButton ( "Drop It!", 210, 420 , 90 , 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $dropit ClipPut(GUICtrlRead($product)) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd 8) Link to comment Share on other sites More sharing options...
JetsterDajet Posted January 3, 2009 Author Share Posted January 3, 2009 Need to read the control AFTER the selections #include <GUIConstantsEx.au3> GUICreate("Test", 500, 500) GUICtrlCreateLabel("test", 135, 10) $productlist = "product1|product2|product3" $product = GUICtrlCreateCombo("Select a Product", 210, 85, 150, 100) GUICtrlSetData(-1, $productlist) $dropit = GUICtrlCreateButton ( "Drop It!", 210, 420 , 90 , 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $dropit ClipPut(GUICtrlRead($product)) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd 8) Oi. Told ya it was easy. Thanks so much! Link to comment Share on other sites More sharing options...
Valuater Posted January 3, 2009 Share Posted January 3, 2009 Oi. Told ya it was easy. Thanks so much!Welcome...And Welcome to the Autoit Forums8) 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