HeaderPane
Main
Hide
Share Link
Print

ItemLevel Property, SftTree Object

Defines an item's level number.

Deprecated - Provided for compatibility with earlier versions only - Use Item.Level instead

Syntax

Get

C#short Level = object.get_ItemLevel(int ItemIndex);
VB.NETLevel = object.get_ItemLevel(ByVal ItemIndex As Integer) As Short
C++short Level = object->ItemLevel[long ItemIndex];
short Level = object->GetItemLevel(long ItemIndex);
CHRESULT object->get_ItemLevel(long ItemIndex, short* Level);
VBLevel = object.ItemLevel(ByVal ItemIndex As Long) As Integer

Put

C#void object.set_ItemLevel(int ItemIndex, short Level);
VB.NETobject.set_ItemLevel(ByVal ItemIndex As Integer, ByVal Level As Short)
C++short object->ItemLevel[long ItemIndex] = Level;
void object->PutItemLevel(long ItemIndex, short Level);
CHRESULT object->put_ItemLevel(long ItemIndex, short Level);
VBobject.ItemLevel(ByVal ItemIndex As Long) = Level As Integer

object

A SftTree object.

ItemIndex

The zero-based index of the item to be accessed.

Level

Defines the item's level number. The valid range is 0 through 63.

Comments

Deprecated - Provided for compatibility with earlier versions only - Use Item.Level instead

The ItemLevel property defines an item's level number.

The ItemLevel property determines the "indentation" of an item. By changing an item's level number, its parent relation is automatically adjusted by the tree control. Using this method, the application does not have to manipulate any parent/child relationships, but can instead treat the entire list of items in a tree control as a linear list, an array of items.

The root (or highest) level is level 0, dependents are on levels 1, 2, 3 and lower. The valid range of levels is 0 through 63.

When changing an item's level using the ItemLevel property, its (current and new) parent items will automatically be expanded to make the item visible.

While logically the first item in the tree control should be at level 0, this is not necessary. Also, a parent item does not necessarily require an immediate dependent (on the next lower level); its first dependent could be on a much lower level. While this is very application specific, SftTree/OCX does allow you to build hierarchies of items where parent/child relationships don't have to follow strict rules.

See Also SftTree Object | Object Hierarchy


Last Updated 11/03/2026 - (email)
© 2026 Softel vdm, Inc.