Weight Property

       

Returns or sets the weight of the characters that make up a Font object. The weight refers to the thickness of the characters, or the “boldness factor”. The higher the value, the bolder the character.

Syntax

object.Weight [= number]

The Weight property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
number A numeric expression specifying the weight of the font.

Remarks

The Font object isn't directly available at design time. You set the Weight property of the Font object by selecting a control's Font property in the Properties window and clicking the Properties button. You implicitly set the Weight property by selecting an item from the Font Style box in the Font dialog box. The Regular and Italic settings have a Weight value of 400 (the default), and the Bold and Bold Italic settings have a Weight value of 700. At run time, however, you set Weight directly by specifying its setting for the Font object.

If you set a Font object's Weight to a value other than 400 or 700 at run time, Visual Basic converts your value to either 400 or 700, depending on which value is closest to the value you set. The precise ranges are: Weight > 400 and < 551 converts to 400; Weight > 550 converts to 700.