MergeCellsproperty
Returns or sets a value that determines whether cells with the same contents should be grouped in a single cell spanning multiple rows or columns.
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 MergeCells () AS MergeCellsSettings
FUNCTION MergeCells (BYVAL merge AS MergeCellsSettings)
Parameters
| Name | Description | |
|---|---|---|
merge | An integer or constant that specifies the grouping (merging) of cells. |
Description
Returns or sets a value that determines whether cells with the same contents should be grouped in a single cell spanning multiple rows or columns.
Remarks
To enable cell merging, you must follow this specific sequence:
- Set the MergeCells property to a value other than 0 (never).
- Set the
MergeRow(index)orMergeCol(index)array properties to True for the specific rows or columns allowed to merge. - Ensure that adjacent cells contain the exact same text. The grid merges automatically based on content and updates immediately when cell text changes.
Example
' Enable global column-based merging grid.MergeCells = flexMergeRestrictColumns
' Allow merging specifically for the first column grid.MergeCol(0) = True
' Populate identical data to trigger the merge grid.TextMatrix(1, 0) = "Region A" grid.TextMatrix(2, 0) = "Region A"
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid