ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / TreeView functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
TreeGetIndex (Function)
In french: ArbreRécupèreIndice
Warning
From version 28 (75), TreeGetSubscript is kept for backward compatibility. This function has been replaced with TreeGetIndex.
Returns the index of an element (node or leaf) in a TreeView control.
Note: This function can be used, for example, to retrieve the index for calling properties on the line of a TreeView control, using the syntax:
TreeView_control[Index].<Property Name> = ...
Example
// Passer en rouge la ligne feuille
nIndice is int
nIndice = TreeGetIndex(ARBRE_Arbre1, "Racine" + TAB + "Noeud" + TAB + "Feuille")
IF nIndice > 0 THEN
	// Vérifie que le noeud est visible avant de le manipuler
	IF ARBRE_Arbre1[nIndice] = -1 THEN 
		// Le noeud n'est pas visible : on le déroule pour le rendre visible
		TreeExpand(ARBRE_Arbre1, "Racine" + TAB + "Noeud" + TAB + "Feuille")
	END
	// Modifie sa couleur
	ARBRE_Arbre1[nIndice].Couleur = DarkRed
END
Syntax
<Result> = TreeGetIndex(<TreeView control> , <Element path>)
<Result>: Integer
  • Index of the found element.
    Please note: Node manipulation is only possible if the node is visible (i.e. unrolled).
  • -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 the element to be used. 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: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/25/2025

Send a report | Local help