Jump to content

GUI Menu cancel Button


Recommended Posts

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

Link to post
Share on other sites

$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
Link to post
Share on other sites

$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]

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...