Share via


Visual Basic: CommonDialog Control

CommonDialog Control (Font Dialog)

See Also   Example   Properties   Methods   Events

The Font dialog is displayed by using the ShowFont method of the CommonDialog control. The Font dialog box allows the user to select a font by specifying a font, size, color, and style.

To use the Font dialog box, set the properties of the CommonDialog control relating to the Font dialog. Then use the ShowFont method to actually show the dialog. Once the user makes selections in the Font dialog box, the following properties contain information about the user's selection:

Property Determines
Color The selected color. To use this property, you must first set the Flags property to cdlCFEffects.
FontBold Whether bold was selected.
FontItalic Whether italic was selected.
FontStrikethru Whether strikethrough was selected. To use this property, you must first set the Flags property to cdlCFEffects.
FontUnderline Whether underline was selected. To use this property, you must first set the Flags property to cdlCFEffects.
FontName The selected font name.
FontSize The selected font size.