When an application needs to prompt a user for input, a dialog box is often used. Several dialog box components are provided within the Windows forms library, or you can create a custom dialog box if necessary. Common Dialog BoxesThe Windows forms library provides several ready-made dialog boxes for Windows applications, including the following:
These classes are also referred to as Windows forms dialog components. You will recognize many of these from your experience with the Windows operating system and Microsoft products such as the Office suite. The dialog classes are derived from the CommonDialog class, which provides the basic functionality for displaying a dialog box. Each dialog class provides a method named ShowDialog that presents the dialog box. Each of the dialog classes has a set of properties that stores the data relevant to its particular type. Modal and Modeless Dialog BoxesWhen a modal dialog box is open , the application can only receive input for the modal dialog box and the code that called the box remains suspended . If a user wants to work with other windows, he or she must close the modal dialog box first. By contrast, a modeless dialog box allows the application to receive input for other windows while the dialog box remains open.
|