ColHeaderproperty
Specifies whether headers should display for the specified band.
Syntax
PROPERTY ColHeader (BYVAL BandNumber AS LONG) AS ColHeaderSettings
PROPERTY ColHeader (BYVAL BandNumber AS LONG, BYVAL settings AS ColHeaderSettings)
PROPERTY ColHeader () AS ColHeaderSettings
PROPERTY ColHeader (BYVAL settings AS ColHeaderSettings)
Parameters
| Name | Description | |
|---|---|---|
BandNumber | A zero‑based index identifying the band specifies that contains the headers that will show or be hidden. If the band number is omited, band 0 is assumed. | |
settings | flexColHeaderOn: The headers display for each band. flexColHeaderOff: No headers display for the band. |
Description
Determines whether column headers are displayed for a specific band in the grid.
Remarks
If you are not using data-bound bands, headers are created by setting FixedRows and assigning text to the first row (Row 0).
Alignment: Use ColAlignment(index) to align data, but note that header text (row 0) sometimes requires separate formatting or manual alignment characters.
Examples
' Define Header Row: Set FixedRows = 1 to create a non-scrolling top row. ' Set Header Text: Use the TextMatrix property to assign titles: grid.FixedRows = 1 grid.TextMatrix(0, 0) = "ID" grif.TextMatrix(0, 1) = "Name"
grid.FixedRows = 2 grid.TextMatrix(0, 0) = "Employee" grid.TextMatrix(1, 0) = "ID"
If grid.MouseRow = 0 Then
' Header clicked → perform sorting
End If
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid