SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines an item's level number.
C
int WINAPI SftTree_GetItemLevel(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemLevel(HWND hwndCtl, int index, int level); int WINAPI SftTreeSplit_GetItemLevel(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemLevel(HWND hwndCtl, int index, int level);
C++
int CSftTree::GetItemLevel(int index) const; BOOL CSftTree::SetItemLevel(int index, int level); int CSftTreeSplit::GetItemLevel(int index) const; BOOL CSftTreeSplit::SetItemLevel(int index, int level);
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item for which the level number is to be retrieved or set.
level
The new, zero-based level number of the item.
GetItemLevel returns the level number of the requested item or -1 if an error occurred.
SetItemLevel returns TRUE if the function was successful, otherwise FALSE is returned.
The GetItemLevel and SetItemLevel functions define an item's level number.
If an item is not visible when its level is set, it is automatically made visible by expanding its parent(s). If an item is collapsed when its level is set, it is first automatically expanded.
The root (or highest) level is level 0, dependents are on levels 1, 2, 3 and lower. The lowest level is defined as level SFTTREE_MAXLEVELS (64).
The SetIndentation function can be used to define the exact indentation for item levels.
In a tree control using a virtual data source, SetItemLevel cannot be used and an error is returned. The level member of the SFTTREE_ITEM structure is used instead.
index = SftTree_AddString(g_hwndTree, TEXT("Progress Bars")); SftTree_SetTextCol(g_hwndTree, index, 0, TEXT("SftTree/DLL supports progress bars as cell background (partial or full size).")); // add progress bar samples { SFTTREE_CELLINFOPARM CellInfo; int i = SftTree_AddString(g_hwndTree, TEXT("Progress Bar - Full Size")); SftTree_SetItemLevel(g_hwndTree, i, 1); CellInfo.version = 7; CellInfo.index = i; CellInfo.iCol = 0; SftTree_GetCellInfo(g_hwndTree, &CellInfo); CellInfo.Cell.progressMax = 100; // maximum value 0 - 100 CellInfo.Cell.progressVal = 33; // current value SftTree_SetCellInfo(g_hwndTree, &CellInfo);
index = m_Tree.AddString(_T("Progress Bars")); m_Tree.SetText(index, 0, _T("SftTree/DLL supports progress bars as cell background (partial or full size).")); // add progress bar samples { SFTTREE_CELLINFOPARM CellInfo; int i = m_Tree.AddString(_T("Progress Bar - Full Size")); m_Tree.SetItemLevel(i, 1); CellInfo.version = 7; CellInfo.index = i; CellInfo.iCol = 0; m_Tree.GetCellInfo(&CellInfo); CellInfo.Cell.progressMax = 100; // maximum value 0 - 100 CellInfo.Cell.progressVal = 33; // current value m_Tree.SetCellInfo(&CellInfo);
See Also C/C++ API | Categories | Notifications