

You can set more than one flag for a dialog box using the Or operator. If this flag is set, the cdlCFBoth and cdlCFScalableOnly flags should also be set. " cdlCFWYSIWYG_&H8000 specifies that the dialog box allows only the selection of fonts that are available on both the printer and on screen. " cdlCFTTOnly_&H40000 specifies that the dialog box allows only the selection of TrueType fonts. " cdlCFScreenFonts_&H1 causes the dialog box to list only the screen fonts " cdlCFScalableOnly_&H20000 specifies that the dialog box allows only the " cdlCFPrinterFonts_&H2 causes the dialog box to list only the fonts supported by the printer, specified by the hDC property.

" cdlCFNoVectorFonts_&H800 specifies that the dialog box doesn't allow " cdlCFNoStyleSel_&H100000 no style was selected. " cdlCFNoSizeSel_&H200000 no font size was selected. " cdlCFNoSimulations_&H1000 specifies that the dialog box doesn't allow graphic device interface (GDI) font simulations. " cdlCFNoFaceSel_&H80000 no font name was selected. Within the range specified by the Min and Max properties. " cdlCFLimitSize_&H2000 specifies that the dialog box selects only font sizes " cdlCFHelpButton_&H4 causes the dialog box to display a Help button. " cdlCFForceFontExist_&H10000 specifies that an error message box is displayed if the user attempts to select a font or style that doesn't exist. " cdlCFFixedPitchOnly_&H4000 specifies that the dialog box selects only " cdlCFEffects_&H100 specifies that the dialog box enables strikethru, underline, and color effects. The hDC property identifies the device context associated with the printer. " cdlCFBoth_&H3 causes the dialog box to list the available printer and screen fonts. " cdlCFApply_&H200 enables the Apply button on the dialog box. If this flag is set, the user won't be able to select a font that contains only symbols.
#WHAT IS COMMON DIALOG BOX IN VB 6.0 WINDOWS#
" cdlCFANSIOnly_&H400 specifies that the dialog box allows only a selection of the fonts that use the Windows character set. Here are the possible values to use with that property:

You can set a wide variety of options when using Font dialog boxes by using the Common Dialog control's Flags property. That's it now we're using Font dialog boxes.The listing for this program,įm,is located in the fontdialog folder on this book's accompanying CD-ROM. Text1.FontUnderline = CommonDialog1.FontUnderline Text1.FontItalic = CommonDialog1.FontItalic Next, we set the Flags property and show the Font dialog box:ĬommonDialog1.Flags = cdlCFBoth Or cdlCFEffectsįinally, we set the text box's properties to match what the user set in the Font dialog box: We start by setting the Common Dialog control's CancelError property to True so clicking the Cancel button causes a trappable error: Here, we'll let the user set the font, font size, and font styles (like underline and bold) in a text box. To use this property, you must first set the Flags property to cdlCFEffects. " FontUnderline_True if underline was selected. " FontStrikethru_True if strikethru was selected. " FontItalic_True if italic was selected. To use this property, you must first set the Flags property If you don't set one of these in the Flags property, a message box is displayedĪdvising the user that There are no fonts installed, which will probably cause them to panic. When the user dismisses the Font dialog box by clicking on OK, you can determine their font selections using these properties of the Common Dialog control: " cdlCFPrinterFonts_&H2 show printer fonts Note that before you use the ShowFont method, you must set the Flags property of the Common Dialog control to one of three constants to indicate if you want to display screen fonts, printer fonts, or both. You use the Common Dialog control's ShowFont method to show a Font dialog box. You ask, should they be able to do that? The Testing Department says, take a look at the Font dialog box. Your new word processor, SuperDuperTextPro, is great, but why can't the users select the font they want to use? T he Testing Department is calling again.
