Help Center

FontWidthHeaderproperty

Returns or sets the width, in points, of the font to be used for text displayed withinthe grid's header area.

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY FontWidthHeader (BYVAL BandNumber AS LONG) AS SINGLE
PROPERTY FontWidthHeader (BYVAL BandNumber AS LONG, BYVAL nWidth AS SINGLE)

Parameters

NameDescription
BandNumberThe index of the hierarchical band (starting at 0 for the top level).
nWidthThe width of the font, in points. A value of 0 typically resets the font to its standard natural width for the current point size.

Description

Returns or sets the width of the font used in the column headers for a specific hierarchical band.

Remarks

This property is only functional when the grid is bound to a Hierarchical Recordset (using the ADO SHAPE command). In unbound mode, only Band 0 is typically available.

In modern maintenance of legacy apps, this property is often used to horizontally compress long header text into narrow columns without reducing the font's vertical height.

Changing the FontWidthHeader does not automatically resize the column. If you increase the font width, you must manually adjust the ColWidth for that band to prevent text clipping.

Example

' Standard header font for the main band grid.FontWidthHeader(0) = 0

' Squeeze child headers in Band 1 to fit smaller columns grid.FontWidthHeader(1) = 6

Reference