PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
TreeGetSubscript (Function)
In french: ArbreRécupèreIndice
Returns the index of an element (node or leaf) in a TreeView control.
Remark: For example, this function gets an index to call the properties of a row in a TreeView control with the following syntax:
TreeView_control[Index].<Property Name> = ...
Example
// Switch the leaf line to red
nIndex is int
nIndex = TreeGetSubscript(TREE_TreeView1, "Root" + TAB + "Node" + TAB + "Leaf")
IF nIndex > 0 THEN
// Checks whether the node is visible before using it
IF TREE_TreeView1[nIndex] = -1 THEN
// The node is not visible: expand it to make it visible
TreeExpand(TREE_TreeView1, "Root" + TAB + "Node" + TAB + "Leaf")
END
// Modifies its color
TREE_TreeView1[nIndex].Color = DarkRed
END
Syntax
<Result> = TreeGetSubscript(<TreeView control> , <Element path>)
<Result>: Integer
  • Index if the element was found.
    Caution: The node can be handled only if it is visible (which means if it is expanded).
  • -1 if the element does not exist.
<TreeView control>: Control name
Name of the TreeView control to be used.
<Element path>: Character string
Full path of element to use. This parameter has the following format:
"<Root name>" + TAB + ["<Name of 1st node>" + TAB + ...
["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>"
If there are two elements with the same name in the path, you can add the IDs of the elements (after their names using TreeID).
Component: wd270obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment