See Also Example
Applies To
Form, check box
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 points .
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 FontName 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
Single
Help:
FontBold, FontItalic, FontStrikethru, FontTransparent, FontUnderline Properties
FontCount Property
Fonts Property
Programmer's Guide:
Chapter 16, "Displaying and Printing Information"
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