Modeless Dialogs

VB.NET supports modeless dialogs as well as modal dialogs. You can typically identify modeless dialogs from their design: modal dialogs have OK and Cancel buttons, while modeless dialogs have Apply and Close buttons. A few programming differences must be noted:

  • The Show method is used to display the modeless dialog (instead of the ShowDialog method).

  • A DialogResult is not returned from the Show method; programmers must implement their own strategy for providing behavior for the Apply and Close buttons in the modeless dialog.

In the program ModelessDialogExample, we use a modeless dialog to add items to a list box. Figure 12-1

Get Application Development Using Visual Basic® and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.