Jump to content

MsgBox


Recommended Posts

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

Link to comment
Share on other sites

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
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...