December 2001
Intermediate to advanced
416 pages
8h 16m
English
The MessageBox class allows for the easy generation of a pop-up dialog box. Typically it consists of message text, one or more buttons, and an optional icon such as the information icon pictured in Figure 6.2.
To display the MessageBox dialog, we invoke an instance of its static member function Show(). For example, the following invocation generated the Bad Data Dialog pictured in Figure 6.3:
string messages = "Please enter your name before pressing OK";
string title = "Bad Data Dialog";
if ( textBox1.Text == string.Empty )
MessageBox.Show( message, title,
MessageBoxButtons.OK,
MessageBoxIcon.Warning );
We invoke a four-parameter instance of Show(). The first parameter is the string displayed within ...
Read now
Unlock full access