bforrestall Posted May 5, 2006 Share Posted May 5, 2006 Hello, I am very new to this and I want to get the return code from what button was clicked on in a message box. What I want is a MsgBox with an OK and CANCEL button. If use clicks OK then script with proceed, if CANCEL is clicked then END. Simple I am sure ...... Thanks! Bill Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 5, 2006 Share Posted May 5, 2006 Hello, I am very new to this and I want to get the return code from what button was clicked on in a message box. What I want is a MsgBox with an OK and CANCEL button. If use clicks OK then script with proceed, if CANCEL is clicked then END. Simple I am sure ...... Thanks! Bill Hi, maybe this is a simple example. $return = MsgBox(1, "Choose", "OK or cancel") If $return = 1 Then MsgBox(0, "", "ok") ElseIf $return = 2 Then MsgBox(0, "", "Cancel") EndIf So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 5, 2006 Moderators Share Posted May 5, 2006 Hello, I am very new to this and I want to get the return code from what button was clicked on in a message box. What I want is a MsgBox with an OK and CANCEL button. If use clicks OK then script with proceed, if CANCEL is clicked then END. Simple I am sure ...... Thanks! BillFirst you have to assign a variable to the msgbox then check that variable afterwards. $MsgBox = MsgBox(1, "Test", "Test") Switch $MsgBox Case 1 MsgBox(0, "Response", "You clicked 'OK'.") Case 2 MsgBox(0, "Response", "You clicked 'Cancel'.") EndSwitch Link to comment Share on other sites More sharing options...
GaryFrost Posted May 5, 2006 Share Posted May 5, 2006 #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK and Cancel, Icon=Question If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(33,"Message Box Test","This is a test") Select Case $iMsgBoxAnswer = 1;OK 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...
BigDod Posted May 5, 2006 Share Posted May 5, 2006 (edited) From the help fileButton......ReturnPressed....Value OK-----------1 CANCEL-----2 ABORT------3 RETRY-------4 IGNORE-----5 YES----------6 NO-----------7 TRY AGAIN-10 CONTINUE--11 Edited May 5, 2006 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
MHz Posted May 5, 2006 Share Posted May 5, 2006 If MsgBox(1, 'title', 'Select OK to proceed') = 2 Then Exit Link to comment Share on other sites More sharing options...
goldenix Posted November 22, 2007 Share Posted November 22, 2007 (edited) A Question, if I use : MsgBox(3, $msgbox_ = MsgBox(3, "codename48", "File Exists. OVERVRITE?")Then none of the examples hire work..because...?yes I need 3 buttons. ( OK, NO, Append ) Edited November 22, 2007 by goldenix My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list] 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