quinner Posted July 23, 2007 Share Posted July 23, 2007 Hi guys Noob question here..... How do I use the buttons on a message box to do different things? I dont know what to write so that the cancel button just cancels..... Any help? CODE#include <GUIConstants.au3> GUICreate("Test", 614, 370) $Button1 = GUICtrlCreateButton("Exit", 96, 104, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitFunc() Case $Button1 ExitFunc() EndSwitch WEnd Func ExitFunc() $msg = GUIGetMsg() MsgBox( 1, "Confirmation", "Really Quit?" ) Exit EndFunc Link to comment Share on other sites More sharing options...
weaponx Posted July 23, 2007 Share Posted July 23, 2007 $RESULT = MsgBox ( 1, "User intervention required", "Allow program: Spybot S&D to run?") ;MsgBox(0,"",$RESULT) Switch $RESULT Case 1 MsgBox(0,"","You clicked OK") Case 2 MsgBox(0,"","You clicked Cancel") EndSwitch Link to comment Share on other sites More sharing options...
quinner Posted July 23, 2007 Author Share Posted July 23, 2007 $RESULT = MsgBox ( 1, "User intervention required", "Allow program: Spybot S&D to run?") ;MsgBox(0,"",$RESULT) Switch $RESULT Case 1 MsgBox(0,"","You clicked OK") Case 2 MsgBox(0,"","You clicked Cancel") EndSwitch Thanks a lot 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