JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the FontDialog Class

As discussed in the In Depth section of this chapter, the FontDialog class displays a dialog box that lets the user select a font. It returns a Font object in the Font property, and a Color object in the Color property. Font dialogs are supported by the FontDialog class. Here is the class hierarchy for that class:

Object
   MarshalByRefObject
      Component
         CommonDialog
            FontDialog

You can find the notable public properties of FontDialog objects in Table 9.15, the notable public methods in Table 9.16, and the notable public events in Table 9.17.

Table 9.15: Noteworthy public properties of FontDialog objects.

Property

Means

AllowSimulations

Gets/sets whether the dialog box allows graphics device interface font simulations.

AllowVectorFonts

Gets/sets whether the dialog box allows vector font selections.

AllowVerticalFonts

Gets/sets whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.

Color

Gets/sets the selected font color.

FixedPitchOnly

Gets/sets whether the dialog box allows only the selection of fixed-pitch fonts.

Font

Gets/sets the selected font.

FontMustExist

Gets/sets whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.

MaxSize

Gets/sets the maximum point size a user can select.

MinSize

Gets/sets the minimum point size a user can select.

ShowApply

Gets/sets whether the dialog box contains an Apply button.

ShowColor

Gets/sets whether the dialog box displays the color choice.

ShowEffects

Gets/sets whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.

ShowHelp

Gets/sets whether the dialog box displays a Help button.

Table 9.16: Noteworthy public methods of FontDialog objects.

Method

Means

Reset

Resets all dialog options to default values.

ShowDialog

Shows the dialog.

Table 9.17: Noteworthy public events of FontDialog objects.

Event

Means

Apply

Occurs when the user clicks the Apply button.

HelpRequest

Occurs when the user clicks the Help button.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor