Type | Description | |||
Item as Variant | A long expression that indicates the handle of the item where the cell is, or 0. If the Item parameter is 0, the ColIndex parameter must indicate the handle of the cell. | |||
ColIndex as Variant | A long expression that indicates the index of the column where a cell is divided, or a long expression that indicates the handle of the cell being divided, if the Item parameter is missing or it is zero. | |||
Long | A long expression that indicates the width of the cell. |
The CellWidth property specifies the width of the cell, where the cell is divided in two or multiple (inner) cells like follows:
By default, the CellWidth property is -1, and so when the user splits a cell the inner cell takes the right half of the area occupied by the master cell.
The following sample splits the first visible cell in three cells:
With Tree1 .BeginUpdate .DrawGridLines = exAllLines With .Items Dim h As HITEM, f As HCELL h = .FirstVisibleItem f = .ItemCell(h, 0) f = .SplitCell(, f) .CellCaption(, f) = "Split 1" f = .SplitCell(, f) .CellCaption(, f) = "Split 2" End With .EndUpdate End With
The following sample specifies that the inner cell should have 32 pixels:
With Tree1 .BeginUpdate .DrawGridLines = exAllLines With .Items Dim h As HITEM, f As HCELL h = .FirstVisibleItem f = .ItemCell(h, 0) f = .SplitCell(, f) .CellCaption(, f) = "Split" .CellWidth(, f) = 32 End With .EndUpdate End With