style Property
Object List Next Object
Defined By: MessageBox
Description:
Bitfield that determines the style of the box (Info, Yes/No/Cancel, etc.) This
property specifies the arrangement of buttons, which button is the default,
which icon is displayed, as well as which windows are unable to accept input
while the box is displayed
Details:
MessageBox’s presentation is controlled by the value contained within the style property.
The values that can be summed together to determine a box’s style are listed below.
To control which buttons appear on the form, one of the following values must
be added into style:
Buttons Values
OK button only. MB_OK 0
OK and Cancel buttons. MB_OKCANCEL 1
Abort, Retry, and Ignore buttons. MB_ABORTRETRYIGNORE 2
Yes, No, and Cancel buttons MB_YESNOCANCEL 3
Yes and No buttons. MB_YESNO 4
Retry and Cancel buttons MB_RETRYCANCEL 5
To designate a default button, one of the following values should be added
into style:
Button Value
First Button MB_DEFBUTTON1 0
Second Button MB_DEFBUTTON2 256
Third Button MB_DEFBUTTON3 512
To choose a particular icon, one of the following values must be added into
style:
Icon Value
Stop Sign MB_ICONSTOP 16
Question Mark MB_ICONQUESTION 32
Exclamation Point MB_ICONEXCLAMATION 48
Info Icon MB_ICONINFORMATION 64
To control the modality of the box, one of the following values must be added
into style:
Modality Value
Prevent interaction with any other
part of the application interface MB_APPLMODAL 0
Prevent interaction with any other
interface item on the system MB_SYSTEMMODAL 4096
Data Type: Long
See Also:
YesNoCancelBox, AbortRetryIgnoreBox, InfoBox, OKCancelBox, RetryCancelBox, YesNoBox, ResetStyle, SetIconExclamation, SetIconInfo, SetIconNone, SetIconQuestion, SetIconStop methods