![]() | Type | Description | ||
| Group as Group | A Group object where the user edits an item. | |||
| Item as HITEM | A long expression that indicates the handle of the item being changed. | |||
| ColIndex as Long | A long expression that specifies the index of the column where the change occurs, or a handle to a cell being edited if the Item parameter is 0. | |||
| NewCaption as String | A string expression that indicates the newly cell's caption. |
The following sample shows how to change the cell's caption when the edit operation ends.
Private Sub ExplorerTree1_AfterCellEdit(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM, ByVal ColIndex As Long, ByVal NewCaption As String)
With Group.Items
.CellCaption(Item, ColIndex) = NewCaption
End With
End Sub
Use the BeforeCellEdit is you need to cancel editing cells. The following sample shows how to cancel editing of any cell owned by the first column:
Private Sub ExplorerTree1_BeforeCellEdit(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM, ByVal ColIndex As Long, Value As Variant, Cancel As Variant)
Cancel = ColIndex = 0
End Sub