Visual Basic Concepts
The common dialog control provides a standard set of dialog boxes for operations such as opening and saving files, setting print options, and selecting colors and fonts. The control also has the ability to display Help by running the Windows Help engine.
Figure 7.11 The common dialog control
The common dialog control provides an interface between Visual Basic and the procedures in the Microsoft Windows dynamic-link library Commdlg.dll. To create a dialog box using this control, Commdlg.dll must be in your Microsoft Windows \System directory.
You use the common dialog control in your application by adding it to a form and setting its properties. The dialog displayed by the control is determined by the methods of the control. At run time, a dialog box is displayed or the Help engine is executed when the appropriate method is invoked; at design time, the common dialog control is displayed as an icon on a form. This icon can't be sized.
The common dialog control allows you to display these commonly used dialog boxes:
To use the common dialog control
When you draw a common dialog control on a form, it automatically resizes itself. Like the timer control, the common dialog control is invisible at run time.
Method | Dialog displayed |
ShowOpen | Open |
ShowSave | Save As |
ShowColor | Color |
ShowFont | Font |
ShowPrinter | |
ShowHelp | Invokes Windows Help |