Jump to content
Sign in to follow this  
revolution

MsgBox

Recommended Posts

revolution

Hello,

sorry for my next topic here with my newbie question, but I have to write a script before this night.

This is my example code

MsgBox( 3, "Select", "Do you want to xyz?")

And this code displays a window with three options: Yes, No and Cancel.

What should I type after above code if I want, for example, button 'yes' to continue, button 'no' to display MsgBox ( MsgBox (0, "OK", "No problem") and Cancel to Sleep(2000) and then exit?

Thanks

Share this post


Link to post
Share on other sites
Tinutron

You just need to declare a variable. :) here is some code:

$variable = MsgBox( 3, "Select", "Do you want to xyz?")

If $variable = 6 Then Whatever()
If $variable = 7 Then MsgBox( 0, "No", "No!")
If $variable = 2 Then Exit


Func Whatever()
    MsgBox( 0, "YES", "stop pressing me >_>")
EndFunc

EDIT: you can find a full list of what will be returned from wich button in the autoit helpfile(MsgBox)

Edited by Tinutron

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.