RocTx Posted July 6, 2006 Share Posted July 6, 2006 I need a nudge...How do you capture or determine what button was pressed in a MsgBox scenario.In the following code the flag 4131 produces a "Yes" "No" "Cancel" button.MsgBox (4131, "Accept?", "Is this Correct?" & @CRLF & @CRLF & ReadInput())How do I determine which one was pressed?Thanks Link to comment Share on other sites More sharing options...
marfdaman Posted July 6, 2006 Share Posted July 6, 2006 Take a look here.Alzo Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
RocTx Posted July 6, 2006 Author Share Posted July 6, 2006 Thanks for the reply Alzo.. I've been there in that same page staring at it.. but I can't see "how" to determine which button was pressed, hence my question. What $variable or @function is the result in, that I can use to query or display what button was pressed? RocTx Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 6, 2006 Moderators Share Posted July 6, 2006 You could try this to see: ConsoleWrite('You Pressed: ' & MsgBox (4131, "Accept?", "Is this Correct?" & @CRLF & @CRLF) & @LF)oÝ÷ Û®öÌ!jÒ ¢Û(jëh×6Switch MsgBox (4131, "Accept?", "Is this Correct?" & @CRLF & @CRLF) Case 2 MsgBox(64, 'Info:', 'You pressed Cancel') Case 6 MsgBox(64, 'Info:', 'You Pressed Yes') Case 7 MsgBox(64, 'Info:', 'You pressed No') EndSwitch Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
RocTx Posted July 6, 2006 Author Share Posted July 6, 2006 Thanks for your reply SmOke_N, Your "Switch" code did not work for me. First it complained about not having "Select". Then when I added select it complained with a "syntax" error with "Switch". But from looking and using your example with "ConsoleWrite" I was able to code it as the following code and that worked! $Pressed=MsgBox (4131, "Accept?", "Is this Correct?" & @CRLF & @CRLF & ReadInput()) MsgBox(4096,"Pressed", "You Pressed " & $Pressed) Thanks again.. RocTx Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 6, 2006 Moderators Share Posted July 6, 2006 Thanks for your reply SmOke_N, Your "Switch" code did not work for me. First it complained about not having "Select". Then when I added select it complained with a "syntax" error with "Switch". But from looking and using your example with "ConsoleWrite" I was able to code it as the following code and that worked! $Pressed=MsgBox (4131, "Accept?", "Is this Correct?" & @CRLF & @CRLF & ReadInput()) MsgBox(4096,"Pressed", "You Pressed " & $Pressed) Thanks again.. RocTxYou have to have Beta to use Switch. Sorry, I saw how long you had been on the forum, and assumed you would have known that. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now