Visual Basic: MSFlexGrid/MSHFlexGrid Controls

FontWidth, FontWidthBand, FontWidthFixed, FontWidthHeader Properties (MSHFlexGrid)

SeeAlso    Example    Applies To

Returns or sets the width, in points, of the font to be used for text displayed within an MSHFlexGrid, or the grid's band, fixed, or header area.

Syntax

object.FontWidth [= value]
object.FontWidthBand [= value]
object.FontWidthFixed [= value]
object.FontWidthHeader [= value]

Syntax for the FontWidth, FontWidthBand, FontWidthFixed, and FontWidthHeader properties has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value Single. A numeric expression that specifies the preferred point width for the current font.

Remarks

The font width is generally chosen by Windows to match the selected font height and provide a standard aspect ratio. However, the MSHFlexGrid enables you to specify fonts that are narrower or wider than the default font. This makes it possible for you to either display more information in a cell or to emphasize a cell.

When specifying a font width, Windows selects or generates a font to match your request. For best results, use TrueType fonts.

To restore the default font width, set this property to zero.

To set the font of individual cells or cell ranges, use the CellFontBold, CellFontItalic, CellFontName, CellFontSize, and CellFontWidth properties.