motormad Posted November 1, 2010 Share Posted November 1, 2010 (edited) My form wont close if a klik the exit (top right red) button. local $nMsg , $msg , $Exit While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_CLOSE or $msg = $Exit ; //If the Exit or Close button is clicked, close the app. Exit ; //Exit the Application Case $msg = $OPEN_B_1 Case $msg = $OPEN_B_2 Case $msg = $OPEN_B_3 EndSwitch WEnd Thanx Sorry I got the mistake local $nMsg , $Exit While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $nMsg = $GUI_EVENT_CLOSE or $nMsg = $Exit Exit Case $nMsg = $OPEN_B_1 Case $nMsg = $OPEN_B_2 Case $nMsg= $OPEN_B_3 EndSwitch WEnd but ... still wil not close Edited November 1, 2010 by motormad Link to comment Share on other sites More sharing options...
wakillon Posted November 1, 2010 Share Posted November 1, 2010 The examples in the help file are clear ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
motormad Posted November 1, 2010 Author Share Posted November 1, 2010 local $Msg , $Exit While 1 $msg = GUIGetMsg() Select Case 0 ContinueLoop Case $msg = $GUI_EVENT_CLOSE Exit Case $Msg = $OPEN_B_1 Case $Msg = $OPEN_B_2 Case $Msg= $OPEN_B_3 Endselect WEnd works fine so ill use this. Probebly a newbie mistake Link to comment Share on other sites More sharing options...
AdamUL Posted November 1, 2010 Share Posted November 1, 2010 Try this.Local $nMsg , $Exit While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Exit Exit Case $OPEN_B_1 Case $OPEN_B_2 Case $OPEN_B_3 EndSwitch WEndSwitch tests $nMsg against the value in each Case statement. You can also have multiple values to test listed in the Case statement separated by a comma, which acts like an OR.Adam 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