FixedRowsproperty
Returns or sets the total number of fixed rows within an MSHFlexGrid.
Syntax
PROPERTY FixedRows () AS LONG
PROPERTY FixedRows (BYVAL nRows AS LONG)
Parameters
| Name | Description | |
|---|---|---|
nRows | Specifies the total number of fixed rows. The value of FixedRows must be at least 1 less than the total number of Rows (unless Rows is 0). |
Description
Returns or sets the total number of fixed rows in the grid. This property specifies how many rows are "frozen" as headers that do not move when the user scrolls through the data.
Remarks
In an MSHFlexGrid, FixedRows generally accounts for the primary headers. If the grid is displaying hierarchical bands, those bands may have their own internal headers, but FixedRows specifically defines the global frozen area at the top.
Cells within fixed rows cannot be selected or edited by the user via standard mouse or keyboard actions, although they can be modified programmatically using the TextMatrix property.
The value of FixedRows must always be less than the total number of rows (Rows). Attempting to set FixedRows equal to or greater than Rows will result in a runtime error.
Fixed columns and rows are constant when you scroll other columns or rows in the MSHFlexGrid. You can specify zero or multiple fixed columns rows. In addition, you can select the colors, font, gridline, and text style of the fixed columns and rows.
If the SelectionMode property is a numerical value, when you select a fixed row at run time, all cells within that row are selected.
If the AllowUserResizing property is a numerical value, you can resize the fixed rows or fixed columns at run time.
Fixed columns and fixed rows are used in spreadsheet applications to display row numbers and column names or letters.
Example
' Ensure total rows are set before defining fixed rows grid.Rows = 20 grid.FixedRows = 2
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid