skody
(Fresh Scripter)
2003-09-25 03:40 PM
Default Button in MessageBox

Hello,

I am using the following messagebox with a 10 second timeout. The default button should be "No" but if I let it time out "Yes" is selected. Any help?

I've this works the same on v4.12 and v4.21

$x=messagebox("This workstation's home office will be the $Office.@crlf@crlf" +
"Would you like to change this workstation's home office?",
"SS&D Windows XP Rollout",4388,10)
if $x=7
"NO" ?
else
"YES" ?
endif

Thanks, in advance, for your help,

Scott


maciep
(Korg Regular)
2003-09-25 04:04 PM
Re: Default Button in MessageBox

If it the box times out, it returns -1.
quote:

Returns: The value returned by MESSAGEBOX indicates which button was selected, as shown in the following table.
Value
Meaning

-1
User did not respond to the dialog box within the specified time-out period.

1
OK button selected.

2
Cancel button selected.

3
Abort button selected.

4
Retry button selected.

5
Ignore button selected.

6
Yes button selected.

7
No button selected





Les
(KiX Master)
2003-09-25 04:08 PM
Re: Default Button in MessageBox

When the dialog comes up, you should notice the heavy line around the No button so the default is working properly. If you let it timeout, then it returns -1, not the default.