ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView control
  • Overview
  • Initializing a TreeView control
  • Populating a TreeView control
  • WLanguage properties associated with the TreeView controls
  • Using properties on a TreeView control
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
Overview
WINDEV and WEBDEV allow you to handle a TreeView control through programming. To do so, use the variable of the TreeView control in the code.
The variable of the TreeView control corresponds to the name of the TreeView control.
This help page explains how to handle a TreeView control through programming.
Remarks:
Initializing a TreeView control

Populating a TreeView control

To initialize a TreeView control, all you have to do is describe all the treeview elements with TreeAdd.
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert", "CAKE-.BMP", "CAKE-.BMP")
TreeAdd(TREE_TVRecipe ,"Recipe" + TAB + "Dessert" + TAB + "Ice cream")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + TAB +  ...
"Vanilla", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + TAB +  ...
"Strawberry", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + TAB +  ...
"Chocolate", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + TAB + ...
"Peach Melba", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + TAB + ...
"Cherry Garcia", ...
"NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + TAB + ...
"Colonel", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie" + TAB + ...
"with whipped cream", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie" + TAB + ...
"with apple brandy", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Crème brûlée", ...
 "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Meringue with cream", ...
"NEXT5-.BMP")
TreeExpand(TREE_TVRecipe, "Recipe")

WLanguage properties associated with the TreeView controls
Several WLanguage properties can be used on the TreeView control. For a complete list of WLanguage properties that can be used with a TreeView control, see Properties associated with TreeView controls.

Using properties on a TreeView control

Example: How to find out the number of elements in a TreeView control:
Trace(TREE_MyTreeView.Count)

Example: How to modify the size of the font for all the elements of a TreeView control:
TREE_MyTreeView.FontSize = 14
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/23/2023

Send a report | Local help