EliTe_ThuT Posted June 21, 2006 Share Posted June 21, 2006 (edited) Hi, I would like to know how to get the value of the pressed button ( with the MsgBox) . I looked in the doc. file but they only say that ok return 1, cancel 2, abort 3... But how can we get those value?For example in a if statement... if "buttun 1" Then Shutdown(0) [...]Edit: Solved by my own... Edited June 21, 2006 by EliTe_ThuT Link to comment Share on other sites More sharing options...
GaryFrost Posted June 21, 2006 Share Posted June 21, 2006 here's an example: #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes, No, and Cancel, Icon=Warning If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(51,"Test","Test of the message box") Select Case $iMsgBoxAnswer = 6;Yes Case $iMsgBoxAnswer = 7;No Case $iMsgBoxAnswer = 2;Cancel EndSelect #EndRegion --- CodeWizard generated code End --- SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
EliTe_ThuT Posted June 21, 2006 Author Share Posted June 21, 2006 here's an example: #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes, No, and Cancel, Icon=Warning If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(51,"Test","Test of the message box") Select Case $iMsgBoxAnswer = 6;Yes Case $iMsgBoxAnswer = 7;No Case $iMsgBoxAnswer = 2;Cancel EndSelect #EndRegion --- CodeWizard generated code End --- I hadn't figured it out that way... this way is much better... 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