Returns or sets the size of the font to be used for text displayed in a control or in a run-time drawing or printing operation.
Note The FontSize property is included for use with the CommonDialog control and for compatibility with earlier versions of Visual Basic. For additional functionality, use the new Font object properties (not available for the CommonDialog control).
Syntax
object.FontSize [= points]
The FontSize property syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
points | A numeric expression specifying the font size to use, in 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 2160 points.
Note Fonts available with Visual Basic vary depending on 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 property before you set size and style attributes with the FontSize, FontBold, FontItalic, FontStrikethru, and FontUnderline 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 Microsoft Windows operating environment uses a different font for TrueType fonts that are smaller than 8 points.