FixedAlignmentproperty
Returns or sets the alignment of data in the fixed cells of a column in an MSHFlexGrid.
Syntax
PROPERTY FixedAlignment (BYVAL Index AS LONG) AS SHORT
PROPERTY FixedAlignment (BYVAL Index AS LONG, BYVAL alignment AS SHORT)
Parameters
| Name | Description | |
|---|---|---|
Index | The zero-based index of the column to be formatted. | |
alignment | An integer or constant that specifies both the horizontal and vertical alignment. |
Description
Returns or sets the alignment of data in the fixed cells of a column in an MSHFlexGrid. Allows you to align column headers independently of the data in the scrollable cells.
The settings for FixedAlignment are the same as those used for ColAlignment:
Remarks
While the global ColAlignment property typically affects an entire column—including its headers—FixedAlignment explicitly overrides that setting for the cells in the fixed rows (headers) of that column.
It is commonly used when you want a column's data to be right-aligned (for numbers) but its header to be centered or left-aligned.
Example
' Set the data area of the second column (Index 1) to right-center grid.ColAlignment(1) = flexAlignRightCenter
' Override only the header (Fixed Row) of the same column to center-center grid.FixedAlignment(1) = flexAlignCenterCenter
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid