Pages

Saturday, 27 August 2011

Display Form as Modal / NonModal in C# Winforms

Forms and dialog boxes are either modal or modeless. A modal form or dialog box must be closed or hidden before you can continue working with the rest of the application.

To display a form as a modal dialog box ..Call the ShowDialog method.

The following example shows how to display a dialog box modally.

// C#
//Display frmAbout as a modal dialog
Form frmAbout = new Form();
frmAbout.ShowDialog();

# Use ShowDialog() method instead of Show() method.

0 comments:

Post a Comment