The jMessageBox control is a composite control that can be used to display a message or question to the operator, and accept their response. Like most controls in the jControls library, it has a rich appearance, employing jControls' fill, border, corner radii, and drop shadow, along with a few additional features.
The jMessageBox control has 3 buttons, each of which are exposed as properties.
Because they are exposed as properties, their appearance can be customized in the designer.
The Buttons property determines how the buttons appear, and what text they display. See the MessageBoxButtons enumeration. The following images show 3 of the many possible examples.
jMessageBox also exposes several properties for setting the buttons' text:
These provide the ability to customize the text that appears on the buttons according to the value of the Buttons property. As an illustrative example, consider how these properties can be used to display a message box in a language other than English.
The MessageLabel property is a jLabel that serves as the message of the jMessageBox.
The Message property is an alias for the MessageLabel.Text property.
The CaptionLabel property is a jLabel that serves as the title bar of the jMessageBox.
The Text property is an alias for the CaptionLabel.Text property.
Typically the jMessageBox would be added to a jUserConrol that is large enough to cover the screen. To show the messagebox, the jUserControl would then be added to a jForm at runtime displayed in front of all other controls with the BringToFront method. Because the jUserControl covers the screen and is displayed in front of all other controls, it prevents the operator from touching any other control except the jMessageBox. When the operator responds to the jMessageBox by pressing one of its buttons, the jUserControl is then removed from the jForm, thus dismissing the jMessageBox. To see a demonstration of this technique, please see the Showcase Visual Studio project template.