1. You can use set of predefined standard dialog boxes in your projects for such tasks as specifying colors and fonts, printing, opening and saving. The common dialog boxes control, which is a custom control, allows your project to use the dialog boxes that are provided as a part of the Windows environment.
2. To use the common dialog control, you first place a control, and its location doesn’t matter, you can not change size of the control, since it will be invisible when your program will run.
3. In code when you wish to display one of the standard dialog boxes, you refer the properties and methods of the control.
4. You don’t need more than one dialog control on your form.
In Visual Basic common dialog box provides commonly used dialog boxes as given below:
We’ll be covering the following topics in this tutorial:
1. Color Dialog Box:
Visual Basic common dialog box provides Color dialog box which can be used for user to select color from the common dialog box. You can assign the values selected by user to controls in your project. This dialog box can be used by writing a code as follows:
2. Font Dialog Box:
Font Dialog Box allows user to select his custom font setting like, font name, font size, font color, font style, strike through etc. To display the font dialog on screen use ShowFont method of the common dialog object.
But before using the ShowFont method you first initiate the flag property for font that is cdlScreenFont.
3. Save Dialog Box:
Visual Basic even provides save file dialog box which displays a save file dialog box to get the path for file to save.