
| Type | Description | |||
| Cell1 as Variant | A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell (in the list, if exists) specifies the cell being displayed in the new larger cell. | |||
| Cell2 as Variant | A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell in the list specifies the cell being displayed in the new larger cell. | |||
| Options as Variant | Reserved. |
The following VB sample adds three columns to a group, a root item and few child items:
With ExplorerTree1
.BeginUpdate
With .Groups.Add("Group")
.BeginUpdate
.Expanded = True
.AutoHeight = True
.MarkSearchColumn = False
.DrawGridLines = exAllLines
.LinesAtRoot = exLinesAtRoot
With .Columns.Item(0)
.Def(exCellCaptionFormat) = exHTML
.Width = 64
End With
.Columns.Add "Column 2"
.Columns.Add "Column 3"
.ColumnAutoResize = True
With .Items
Dim h As Long
h = .AddItem("Root. This is the root item")
.InsertItem h, , Array("Child 1", "SubItem 2", "SubItem 3")
.InsertItem h, , Array("Child 2", "SubItem 2", "SubItem 3")
.ExpandItem(h) = True
End With
.EndUpdate
End With
.EndUpdate
End With

(note that the caption of the root item is truncated by the column it belongs to)
If we are merging the first three cells in the root item we get:

The following VB sample merges the first three cells in the root item:
With ExplorerTree1.Groups(0)
With .Items
.CellMerge(.RootItem(0), 0) = Array(1, 2)
End With
End With
With ExplorerTree1.Groups(0)
.BeginUpdate
With .Items
Dim r As Long
r = .RootItem(0)
.CellMerge(r, 0) = 1
.CellMerge(r, 0) = 2
End With
.EndUpdate
End With
With ExplorerTree1.Groups(0)
.BeginUpdate
With .Items
Dim r As Long
r = .RootItem(0)
.MergeCells .ItemCell(r, 0), .ItemCell(r, 1)
.MergeCells .ItemCell(r, 0), .ItemCell(r, 2)
End With
.EndUpdate
End With
With ExplorerTree1.Groups(0)
With .Items
Dim r As Long
r = .RootItem(0)
.MergeCells .ItemCell(r, 0), Array(.ItemCell(r, 1), .ItemCell(r, 2))
End With
End With
With ExplorerTree1.Groups(0)
With .Items
Dim r As Long
r = .RootItem(0)
.MergeCells Array(.ItemCell(r, 0), .ItemCell(r, 1), .ItemCell(r, 2))
End With
End