FontFixedproperty
Returns or sets the font of the text in the fixed cells.
Syntax
PROPERTY FontFixed () AS IFont PTR
PROPERTY FontFixed (BYVAL pFont AS IFont PTR)
Parameters
| Name | Description | |
|---|---|---|
pFont | A pointer to an IFont object. |
Description
Returns or sets a Font object used to display text in all fixed rows and fixed columns (the non-scrolling headers).
Remarks
While the standard Font property controls the appearance of data in the scrollable area, FontFixed allows you to apply a distinct visual style to the headers. This is a "global" property for the fixed section; it applies to all fixed cells simultaneously.
Examples
' Ensure there is at least one fixed row grid.FixedRows = 1
' Set header font properties grid.FontFixed->Name = "Segoe UI" grid.FontFixed->Size = 10 grid.FontFixed->Bold = True
' Set standard data font for contrast grid.Font->Name = "Tahoma" grid.Font->Size = 9 grid.Font->Bold = False
To make your grid headers stand out from the data:
When maintaining legacy apps on modern Windows versions, using FontFixed.Bold = True is the most common way to ensure headers remain distinguishable on high-DPI displays. However, remember that bolding text often makes it wider; you may need to manually increase the ColWidth or RowHeight of the fixed cells to prevent the text from being cut off.
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid