property Items.ItemDivider(Item as HITEM) as Long
Specifies whether the item acts like a divider item. The value indicates the index of column used to define the divider's title.

 TypeDescription 
   Item as HITEM A long expression that indicates the item's handle.  
   Long A long expression that indicates the column's index.  
A divider item uses the item's client area to display a single cell. The ItemDivider property specifies the index of the cell being displayed. In other words, the divider item merges the item cells into a single cell. Use the ItemDividerLine property to define the line that underlines the divider item. Use the LockedItemCount property to lock items on the top or bottom side of the control. Use the MergeCells method to combine two or multiple cells in a single cell. Use the SelectableItem property to specify the user can select an item. A divider item has sense for a control with multiple columns. 

The following Template draws a custom line ( from a skin object ) between two items:

The sample loads the skin file using the Add method, and the ItemBackColor(k) = 16777216, specifies that skin with the skin with the identifier 1 ( the 16777216 is the 0x1000000 in hexa representation ) paints the item's background. 

The following VB sample adds a divider item that's locked to the top side of the control ( Before running this sample please make sure that your control has columns ):

With Tree1
    .BeginUpdate
    .DrawGridLines = exNoLines
    With .Items
        .LockedItemCount(TopAlignment) = 1
        Dim h As HITEM
        h = .LockedItem(TopAlignment, 0)
        .ItemDivider(h) = 0
        .ItemHeight(h) = 22
        .CellCaption(h, 0) = "<b>Total</b>: $12.344.233"
        .CellCaptionFormat(h, 0) = exHTML
        .CellHAlignment(h, 0) = RightAlignment
    End With
    .EndUpdate
End With

The following C++ sample adds a divider item, that's not selectable too:

#include "Items.h"
CItems items = m_tree.GetItems();
long i = items.AddItem( COleVariant("divider item") );
items.SetItemDivider( i, 0 );
items.SetSelectableItem( i, FALSE );

The following C# sample adds a divider item, that's not selectable too:

int i = axTree1.Items.AddItem("divider item");
axTree1.Items.set_ItemDivider(i, 0);
axTree1.Items.set_SelectableItem(i, false);

The following VB.NET sample adds a divider item, that's not selectable too:

With AxTree1.Items
    Dim i As Integer
    i = .AddItem("divider item")
    .ItemDivider(i) = 0
    .SelectableItem(i) = False
End With

The following VFP sample adds a divider item, that's not selectable too:

with thisform.Tree1.Items
	.DefaultItem = .AddItem("divider item")
	.ItemDivider(0) = 0
	.SelectableItem(0) = .f.
endwith

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.