"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Class: CFontDialog
Displaying the Font Common Dialog without using the Microsoft Common Dialog Control
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CFontDialog class
|
|
Color
|
Property
|
Gets the font color
|
|
Flags
|
Property
|
Sets the flags for the dialog.
The Flags property can have the following values:
FonScreenFonts - Causes the dialog to display only the available screen fonts.
FonPrinterFonts - Causes the dialog to display only the available printer fonts.
FonBoth = Causes the dialog to display both screen and printer fonts.
FonShowHelp - Unsupported in this class
FonEnableHook - Unsupported in this class
FonEnableTemplate - Unsupported in this class
FonEnableTemplateHandle - Unsupported in this class
FonInitToLogFontStruct - Causes the dialog to be initialized with the values specified in the LOGFONT type.
FonEffects - Causes the dialog to show additional that allow the user to specify strikeout, Underline, and Color.
FonApply - Unsupported in this class
FonNoVectorFonts - Prevents the user from selecting vector fonts.
FonNoOEMFonts - Same as FonNoVectorFonts
FonNoSimulations - Prevents the dialog from using font simulations.
FonLimitSize - Causes the dialog to limit font size selections to the range specified in the Min and Max properties.
FonFixedPitchOnly - Forces the user to select fixed pitch fonts.
FonWYSIWYG - Causes the dialog to display on those fonts available on both the screen and printer.
FonForceFontExist - Causes the dialog to raise an error if the user tries to select a font that does not exist.
FonScalableOnly - Causes the dialog to allow only the selection of scalable fonts.
FonTTOnly - Causes the dialog to allow only the selection of true type fonts.
FonNoFaceSel - Prevents the dialog from initially displaying a selection for the font name.
FonNoStyleSel - Prevents the dialog from initially displaying a selection for the font style.
FonNoSizeSel - Prevents the dialog from initially displaying a selection for the font size.
Multiple flags can be specified using the following syntax:
FontDialog.Flags = FonNoStyleSel Or FonNoSizeSel
|
|
Font
|
Property
|
Gets a Font object representating the selections made in the Font dialog
This property should be used with the Set syntax. For example:
Set FontDialog.Font = mFont
You must use the FonInitToLogFontStruct flag for these settings to work.
|
|
FontType
|
Property
|
Gets the font type.
The FontType property can have one or more of the following values:
FonSimulated - The font is simulated.
FonPrinter - The font is a printer font.
FonScreen - The font is a screen font.
FonBold - The font is bold.
FonItalic - The font is italic.
FonRegular - The font is not bold.
|
|
hWndParent
|
Property
|
Sets the parent hWnd. This can be a handle to any vlaid window.
|
|
Max
|
Property
|
Sets the current maximum font size. You must use the FonLimitSize flag for this property to work.
|
|
Min
|
Property
|
Sets the current minimum font size. You must use the FonLimitSize flag for this property to work.
|
|
Style
|
Property
|
Sets the font style.
If the FonUseStyle flags is specified, the style combo is initialized to the value of this property. When the dialog closes, this property contains the user's selection.
|
|
Class_Initialize
|
Initialize
|
Set initial values to defaults which may be overridden with property settings
|
|
HeightToPoints
|
Private
|
Converts a font height to a font point size.
The font height is measured in logical device units. Most windows API functions for dealing with fonts require the font height in logical units. This function only works correctly in the MM_TEXT mapping mode.
|
|
PointsToHeight
|
Private
|
Converts a font point size to a font height (in pixels).
The font height is measured in logical device units. Most windows API functions for dealing with fonts require the font height in logical units. This function only works correctly in the MM_TEXT mapping mode.
|
|
Show
|
Method
|
Displays the font common dialog
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|