Adding Dialog Box control
You will not find the Common Dialog Box control on
the toolbox. To add the control to the toolbox follow
the following steps:
- Press Ctrl+T (shortcut key for Project, Components)
to display the Components dialog box shown in the
following figure:
Figure 16.1
- Select the control labeled Microsoft Common Dialog
Control 6.0.
- Click OK to add the control in your toolbox.
The following figure shows a Common Dialog Box control
placed in the center of a form.
Figure 16.2
At run time, use the appropriate method, as listed
in the following table, to display the desired dialog.
Method |
Dialog displayed |
ShowOpen |
Open |
ShowSave |
Save As |
ShowColor |
Color |
ShowFont |
Font |
ShowPrinter |
Print |
ShowHelp |
Invokes Windows
Help |
If you named a Common Dialog Box control dlgOpen,
you can apply the ShowOpen method to display the Open
dialog box.
dlgOpen.ShowOpen
|
You can use a single dialog box
control in an application and apply different
methods to it. |
|