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.
object.Weight [= number]
The parts of the Weight property syntax are described in the following table.
Part | Description |
---|---|
object | An object expression that evaluates to an object. |
number | A numeric expression specifying the weight of the font. |
The Font object is not 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.