Colsproperty
Returns or sets the total number of columns in an MSHFlexGrid.
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 Cols (BYVAL BandNumber AS LONG) AS LONG
PROPERTY Cols (BYVAL BandNumber AS LONG, BYVAL nCols AS LONG)
PROPERTY Cols () AS LONG
PROPERTY Cols (BYVAL nCols AS LONG)
Parameters
| Name | Description | |
|---|---|---|
BandNumber | A zero‑based index identifying the band whose background column count is being retrieved or modified. If the band number is omited, band 0 is assumed. | |
nCols | Specifies the number of columns. The value of nCols must be at least one greater than the value of FixedCols, unless they are both set to zero. |
Description
Returns or sets the total number of columns in the grid.
Remarks
Dynamic resizing: You can add or remove columns at runtime by changing this value. For example, grid.Cols = 10 immediately sets the grid to have 10 columns.
Zero-based indexing: Columns are indexed starting at 0. If Cols is set to 5, the valid column indices are 0 through 4.
Fixed columns: The FixedCols property (which defines non-scrolling label columns) must always be less than the total Cols value.
Example
' Total columns must be greater than FixedCols grid.Cols = 6 ' 1 fixed + 5 data grid.FixedCols = 1 ' Freeze the first column
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid