Jump to content
Sign in to follow this  
IvanCodin

GUI Menu cancel Button

Recommended Posts

IvanCodin

How do I define what happens what the cancel button is pressed? I want to give an option to press cancel and then exit the script if cancel is pressed.

<-- script -->

$UserInput = "test"

Do

$answer = InputBox("Info is Required", "Please Input Your Access code.", "", "*")

If $answer == $UserInput Then

; move on

Else

MsgBox(0,"Invalid", "Please enter the access code. Try Again.")

EndIf

Until $answer == $UserInput

<-- /script -->

The help file indicates a return @Error of 1 is returned from the cancel button. How do you set what is done when the error return value is sent?

CC

Share this post


Link to post
Share on other sites
The Ape

$UserInput = "test"
Do
    $answer = InputBox("Info is Required", "Please Input Your Access code.", "", "*")
    If $answer == $UserInput Then
        ; move on
    ElseIf @error = 1 Then
        Exit
    Else
        MsgBox(0, "Invalid", "Please enter the access code. Try Again.")
    EndIf
Until $answer == $UserInput

Edited by The Ape

Share this post


Link to post
Share on other sites
star2

$UserInput = "test"

Do
$answer = InputBox("Info is Required", "Please Input Your Access code.", "", "*")
If @error = 1 Then
    MsgBox (-1,"test" , "you pressed Cancel")
ElseIf $answer = $UserInput Then
    MsgBox (-1,"test","you typed test" & @crlf & "now Exiting")
ElseIf $answer <> $UserInput Then
    MsgBox (-1, "test", "you have entered the wrong password")
EndIf

Until $answer = $UserInput

I'm not sure what u want !!!

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Share this post


Link to post
Share on other sites
IvanCodin

Thanks for the assist!!! Thats exactly what I was tring to do. Ask for an entry and give the user an option to press cancel to exit is desired.

Me

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.