Jump to content

How to detect if a MsgBox OK or CANCEL button was pressed?


Reloaded
 Share

Recommended Posts

put variable infront msgbox an do

If $var = 1 then..

from help file

Return Value

Success: Returns the ID of the button pressed.

Failure: Returns -1 if the message box timed out.

Button Pressed Return Value

OK 1

CANCEL 2

ABORT 3

RETRY 4

IGNORE 5

YES 6

NO 7

TRY AGAIN ** 10

CONTINUE ** 11

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

put variable infront msgbox an do

If $var = 1 then..

from help file

Ok thanks that worked!

Now here is what i have so far and if the button NO is pressed how can i stop the program from being exited because ExitLoop and Exit just closes the program.

$msgBox = MsgBox(4, "Title", "Label") ; i decided to change to a YES and NO so NO's ID = 7
  If $msgBox = 7 Then
    Exit ; how can i break out of this IF statement without closing the whole program?
  Else
    xfSkinVista()
  EndIf
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...