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. | |||
Index as Variant | A long expression that indicates the index of the inner being requested. If the Index parameter is missing or it is zero, the InnerCell property retrieves the master cell. | |||
Variant | A long expression that indicates the handle of the inner cell. |
The following VB sample specifies whether a cell contains inner cells ( the function checks whether a cell is splitted ):
Private Function isSplit(ByVal g As EXTREELibCtl.Tree, ByVal h As EXTREELibCtl.HITEM, ByVal c As Long) As Boolean With g.Items isSplit = IIf(Not .InnerCell(h, c, 0) = .InnerCell(h, c, 1), True, False) End With End Function
The following VB sample gets the master cell:
Private Function getMaster(ByVal g As EXTREELibCtl.Tree, ByVal h As EXTREELibCtl.HITEM, ByVal c As Long) As EXTREELibCtl.HCELL With g.Items Dim r As EXTREELibCtl.HCELL r = c If Not (h = 0) Then r = .ItemCell(h, c) End If While Not (.CellParent(, r) = 0) r = .CellParent(, r) Wend getMaster = r End With End Function
The following VB sample counts the inner cells:
Private Function getInnerCount(ByVal g As EXTREELibCtl.Tree, ByVal h As EXTREELibCtl.HITEM, ByVal c As Long) As Long With g.Items Dim i As Long i = -1 Do i = i + 1 Loop While Not (.InnerCell(h, c, i) = .InnerCell(h, c, i + 1)) getInnerCount = i End With End Function
The following C++ sample specifies whether a cell contains inner cells ( the function checks whether a cell is splitted ):
long V2I( VARIANT* pvtValue ) { COleVariant vtResult; vtResult.ChangeType( VT_I4, pvtValue ); return V_I4( &vtResult ); } BOOL isSplit( CTree& tree, long h, long c ) { CItems items = tree.GetItems(); return V2I( &items.GetInnerCell( COleVariant( h ), COleVariant( c ), COleVariant( (long)0 ) ) ) != V2I( &items.GetInnerCell( COleVariant( h ), COleVariant( c ), COleVariant( (long)1 ) ) ); }
The following C++ sample gets the master cell:
long getMaster( CTree& tree, long h, long c ) { COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; CItems items = tree.GetItems(); long r = c; if ( h != 0 ) r = items.GetItemCell( h, COleVariant( c ) ); while ( V2I( &items.GetCellParent( vtMissing, COleVariant( r ) ) ) != 0 ) r = V2I( &items.GetCellParent( vtMissing, COleVariant( r ) ) ); return r; }
The following C++ sample counts the inner cells:
long getInnerCount( CTree& tree, long h, long c ) { CItems items = tree.GetItems(); COleVariant vtItem( h ), vtColumn( c ); long i = -1; do { i++; } while ( V2I( &items.GetInnerCell( vtItem, vtColumn, COleVariant( i ) ) ) != V2I( &items.GetInnerCell( vtItem, vtColumn, COleVariant( (long)(i + 1) ) ) ) ); return i; }
The following VB.NET sample splits the first visible cell in two cells:
With AxTree1.Items Dim i As Object i = .SplitCell(.FirstVisibleItem, 0) .CellCaption(Nothing, i) = "inner cell" End With
The following C# sample splits the first visible cell in two cells:
EXTREELib.Items items = axTree1.Items; object i = items.get_SplitCell(items.FirstVisibleItem, 0); items.set_CellCaption(null, i, "inner cell");
The following VFP sample splits the first visible cell in two cells:
with thisform.Tree1.Items local i i = .SplitCell(.FirstVisibleItem,0) local s, crlf crlf = chr(13) + chr(10) s = "Items" + crlf s = s + "{" + crlf s = s + "CellCaption(," + str(i) + ") = " + chr(34) + "inner cell" + chr(34) + crlf s = s + "}" thisform.Tree1.Template = s endwith