Chapter 3. Dialogs


3. Dialogs

A dialog is defined by its use. If a form is the application's main window, it's a window and not a dialog. However, if a form pops up in response to a user request for service, such as a request to open a file, and stops all other user interactions with the application, it's a dialog (specifically, a modal dialog).

However, things get a little murky when we consider modeless dialogs, such as Outlook's Send/Receive Progress dialog. Modeless dialogs don't stop the user from interacting with the rest of the application, but they do provide a means of interaction outside the main window.

The Windows Forms terminology makes things even murkier. Standard dialogs are exposed by the XxxDialog family of components, such as OpenFileDialog. Most of these components support only modal activation using ShowDialog, but a couple of them support modeless activation using Show. In contrast, custom dialogs are classes that derive from the Form base class and can be shown modally or modelessly based on whether they're activated using ShowDialog or Show.

No matter how a dialog is defined, this chapter covers things you'd normally think of as dialog-related, including standard dialogs, custom forms to be used as dialogs, modal and modeless activation and lifetime, transferring data in and out, validating user-entered data, and providing help. To aid you in making the transition to the unification of dialoglike functionality with forms, I use the term "dialog" only when I'm referring to the standard dialog components.




Windows Forms 2.0 Programming
Windows Forms 2.0 Programming (Microsoft .NET Development Series)
ISBN: 0321267966
EAN: 2147483647
Year: 2006
Pages: 216

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net