Jump to content

Use a combobox to declare a variable


Recommended Posts

I have been banging my head againist the wall for a hour trying to figure this out. Can someone please explain why this does not work and the final message box doesn't appear?

Thanks

#include <GUIConstantsEx.au3>
Dim $store
$hGUI = GUICreate("Test", 500, 500)
$hCombo = GUICtrlCreateCombo("Item 1", 10, 10, 100, 20)
GUICtrlSetData(-1, "Item 2|Item 3")
$hButton = GUICtrlCreateButton("Read", 10, 50, 80, 30)
GUISetState()
While 1
Switch GUIGetMsg()
     Case $GUI_EVENT_CLOSE
         Exit
     Case $hButton
         $store = GUICtrlRead($hCombo)
         Exit
EndSwitch
WEnd
MsgBox(0, "test", $store)
Link to comment
Share on other sites

change every Exit to ExitLoop cos Exit is to exit app

or

add msgbox before every exit

as for combobox to declare you can try Assign() or you mistuped in yout post title and you mented to say to "Use a combobox to set a variable" and i misunderstud you

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

change every Exit to ExitLoop cos Exit is to exit app

or

add msgbox before every exit

as for combobox to declare you can try Assign() or you mistuped in yout post title and you mented to say to "Use a combobox to set a variable" and i misunderstud you

Doh! Thanks I totally did not understand the difference between End and Endloop
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...