Table of Contents
jMessageBox
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 NF4 library, it has a rich appearance, employing jControls NF4's fill, border, corner radii, and drop shadow, along with a few additional features.
Button Properties
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.
Buttons Property
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.
Button Text Properties
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.
MessageLabel Property
The MessageLabel property is a jLabel that serves as the message of the jMessageBox.
Message Property
The Message property is an alias for the MessageLabel.Text property.
CaptionLabel Property
The CaptionLabel property is a jLabel that serves as the title bar of the jMessageBox.
Text Property
The Text property is an alias for the CaptionLabel.Text property.
Showing the jMessageBox at Runtime
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.
















