8.5. Message boxes

To display a predefined dialog box, we use the static MessageBox class. This class has only one method – the Show method. It is used to display a message box and its properties are used to determine the title, message, buttons, and icons shown in it. Table 8.3 shows different overloaded versions of the Show method and explains when to use each of them.

Table 8.3. What the various parameters of Show are used for
Parameters Used to
String Display a message box with the specified text.
String, String Display a message box with the specified text and caption.
String, String, MessageBoxButtons Display a message box with the specified text, caption, and buttons
String, String, MessageBoxButtons, MessageBoxIcon Display a message ...

Get A Programmer's Guide to .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.