FontSize Property

See Also78RCG0                 Example10RAYKM>Low

Applies To

Form14TJ2LN, check box9P3BU5, combo box1YZXFF6, command buttonXJSPC0, common dialog1H1HYJI, data control2E1FEX3, directory list boxO9U5A0, drive list box5WJO0PW, file list box1M6S8UX, frame1KX6ZP8, grid2VGT0PT, label3MNIZ8D, list boxG11UCK, option buttonJYBO08, picture box31MYIWX, Printer objectCBQUDQ, text boxYPYZDG.

Description

Determines the size of the font to be used for text displayed in a control or in a run-time drawing or printing operation.

Usage

{ [form.][control.]|Printer.}FontSize[ = points ]

Remarks

Use this property to format text in the font size you want.  The default is determined by the system.  To change the default, specify the size of the font in points95MO9S3.

The maximum value for FontSize is 2048 points.

 

Note   Fonts available with Visual Basic vary according to your system configuration, display devices, and printing devices.  Font-related properties can be set only to values for which fonts exist.

In general, you should change the FontNameB3RMO3 property before you set size and style attributes with the FontSize, FontBold5NZYQSD, FontItalic5NZYQSD, FontStrikethru5NZYQSD, FontTransparent5NZYQSD, and FontUnderline5NZYQSD properties.  However, when you set TrueType fonts to smaller than 8 points, you should set the point size with the FontSize property, then set the FontName property, and then set the size again with the FontSize property.  The Windows environment uses a different font for TrueType fonts that are smaller than 8 points.

 

Data Type

Single6H5W9RZ


See Also

Help:

FontBold, FontItalic, FontStrikethru, FontTransparent, FontUnderline Properties5NZYQSD

FontCount Property8I4LCS

Fonts Property5O9Q07P

 

Programmer's Guide:

Chapter 16, "Displaying and Printing Information"


FontSize Property Example

The example prints text on your form in two different point sizes with each click of the mouse.  To try this example, paste the code into the Declarations section of a form.  Press F5 to run the program and then click the form.

Sub Form_Click ()
  FontSize = 24                    ' Set FontSize.
  Print "This is 24 point type."   ' Print large type.
  FontSize = 8                     ' Set FontSize.
  Print "This is 8 point type."    ' Print small type.
End Sub