MessageBox

Object List Hierarchy Next Object

Definition:

Encapsulates features common to all the message box objects. The family of message boxes provides an easy way to access and create basic messages that inform the user of a condition or solicit a simple yes/no/cancel answer.

Specialized Features:

The following tables list and describe the properties and methods added by MessageBox. There are no added events.


Properties Use to...


hwndOwner Control whether the box is displayed as application or system modal.

message Determine the text string that the box will display as its message.

result Access the result of the last posting of the message box.

style Determine the style of the box (Info, Yes/No/Cancel, etc.)

title Determine the text string that appears in the title bar of the box.


Methods Use to...


Execute Display the box modally.

Message Reset the title and message properties of the box and display it modally in a single step.

Msg Reset the message property of the box and display it modally in a single step.

ResetStyle Reset the style of the box to its default.

SetIconExclamation Reset the box icon to the Exclamation point.

SetIconInfo Reset the box icon to the information icon.

SetIconNone Reset the box icon to be empty.

SetIconQuestion Reset the box icon to the Question mark.

SetIconStop Reset the box icon to the Stop sign.

Copied Features:

Noneimages/Phx00010.gifthis is a top-level object.

Details:

The MessageBox family consists of six different objects: AbortRetryIgnoreBox, InfoBox, OkCancelBox, RetryCancelBox, YesNoBox, and YesNoCancelBox. They are constructed as encapsulations of the Win32 API function MessageBox, whose declaration is specified in the Globals object User32. MessageBox is capable of displaying any of the many forms of message boxes by setting its properties appropriately. The other members of the MessageBox family are specializations of MessageBox that simplify the display of some of the more common forms of message boxes.