Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What values does a Y/N messagebox return?

Status
Not open for further replies.

tristero

Programmer
Jan 24, 2003
95
US
Yes = ?
No = ?



Dan Trenz
Ann Arbor, MI
 

Yes = 6

No = 7


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
thank you!

not exactly intuitive...

Dan Trenz
Ann Arbor, MI
 
tristero

According to the help file:
Remarks
The value MESSAGEBOX( ) returns indicates which button in the dialog box was chosen. In dialog boxes with a Cancel button, pressing ESC to exit the dialog box returns the same value (2) as choosing Cancel.

Note that the shortest abbreviation for this function is MESSAGEB( ).

The following table lists the values MESSAGEBOX( ) returns for each button.

Return value Button
1 OK
2 Cancel
3 Abort
4 Retry
5 Ignore
6 Yes
7 No


You also use:

val=MESSAGEBOX("",4)
? val


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Intuitive no, but consisten with other languages.

I decided to write my own messagebox wrappers to handle this. Check out:

faq184-4346 Messagebox - YESNO
faq184-4348 Messagebox - INFO
faq184-4347 Messagebox - STOP

These will also display the proper icon and application name.


Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top