erezlevi Posted June 27, 2008 Share Posted June 27, 2008 hi, this is my code: #include <Array.au3> #include <File.au3> #include <GUIconstants.au3> GUICreate ("change VDN Var",300,300,100,100) GUICtrlCreateCombo ("Choose VDN",10,10) GUICtrlSetData (-1,"17001|17002|17993") GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend now, I need to know who to make something happen like "msgbox" if the user choose VDN 17001, and if he choose 17002 to display something else, without including a "submit" button, but automatically, meaning if the user opened the combo and choose 17002 a msgbox imidiatly apear saying you choose 17002. Thanks, Link to comment Share on other sites More sharing options...
erezlevi Posted June 27, 2008 Author Share Posted June 27, 2008 well, this does what I need but it does not give time for the user to make the choosing he wants. #include <Array.au3> #include <File.au3> #include <GUIconstants.au3> GUICreate("change VDN Var", 300, 300, 100, 100) $M = GUICtrlCreateCombo("Choose VDN", 10, 10) GUICtrlSetData(-1, "17001|17002|17993") GUISetState() While 1 sleep (500) $s = GUICtrlRead($M) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $s = "17001" MsgBox(0, "17001", "") Case $s = "17002" MsgBox(0, "17002", "") Case $s = "17993" MsgBox(0, "17993", "") EndSelect WEnd anyone? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted June 27, 2008 Share Posted June 27, 2008 Use Case $msg = $M To react to changes and then either A. If...ElseIf...Else...EndIf B. Switch...Case...EndSwitch to check what value is selected .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
rasim Posted June 27, 2008 Share Posted June 27, 2008 erezleviDon`t use a Sleep() function in loop with GUIGetMsg() function.Example:GUICreate("change VDN Var", 300, 300, 100, 100) $M = GUICtrlCreateCombo("Choose VDN", 10, 10) GUICtrlSetData(-1, "17001|17002|17993") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -3 ExitLoop Case $msg = $M $read = GUICtrlRead($M) MsgBox(0, "", $read) EndSelect WEnd 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