PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Handling the elements of a Treeview control directly
  • WLanguage functions
  • Direct operation
  • Initializing an element in a Treeview control
  • Initializing an element
  • Associating a tooltip with an element
  • Selecting an element in a TreeView control
  • Selecting the element of row whose subscript is
  • Positioning on the last element of the TreeView control
  • Retrieving the element selected in the TreeView control
  • WLanguage properties associated with the elements of a TreeView control
  • Using properties on an element of a TreeView control
  • Examples
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
This help page explains how to handle the elements of a Treeview control either directly or via the WLanguage functions.
You can:
WEBDEV - Browser code This version can only be used to retrieve the element selected in a Treeview control.
Handling the elements of a Treeview control directly

WLanguage functions

In the WLanguage functions for managing the TreeView controls, the element of the TreeView control is handled via its full path (from the root of the treeview). This path has the following format:
"<Name of Root>" + TAB + ["<Name of 1st Node>" + TAB + ...
["<Name of 2nd Node>" + TAB + [...]]]"<Leaf Name>"
The different elements that constitute the path of characters strings are separated by TAB characters.
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Direct operation

To handle a treeview element directly (with the WLanguage properties for example), two notations are available:
  • Operation performed via the subscript of the element:
    All you have to do is use the following notation: <Name of TreeView Control> [ <Element Subscript>].
    Caution: The specified subscripts only take the visible elements into account.
    Example: Modifying the color of the 5th element displayed in a TreeView control:
    TREE_MyTreeView[5]..Color = LightRed
  • Operation performed via the full path of the element:
    All you have to do is use the following notation: <Name of TreeView Control> [ <Element Path>].
    The path of the element is a character string in the following format:
    "<Name of Root>" + TAB + ["<Name of 1st Node>" + TAB + ...
    ["<Name of 2nd Node>" + TAB + [...]]]"<Leaf Name>"

    Example: Modifying the color of the "Pineapple" element.
    TREE_MyTreeView["Recipe" + TAB + "Dessert" + TAB + "Pineapple"]..Color = LightRed
You also have the ability to use the following notation to identify the current element in a TreeView control:
MySelf[TreeSelect(MySelf)]
Initializing an element in a Treeview control
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Initializing an element

To initialize an element found in a TreeView control, use TreeAdd.
During this addition, you can:
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Associating a tooltip with an element

To associate a tooltip with an element in a Treeview control, you can use:
If the text of the element tooltip is not specified, the text displayed will be the text of the tooltip for the TreeView control (if it exists).
Reminder: By default, the tooltip associated with the different controls is displayed. To specify whether the tooltips must be displayed or not, use ShowToolTip.
Selecting an element in a TreeView control
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Selecting the element of row whose subscript is <Subscript>

To select the element found at <Subscript> row, use:
  • the direct assignment:
    <TreeView> = Subscript

    If the row is displayed in the TreeView control, the corresponding element is selected.
  • TreeSelectPlus:
    TreeSelectPlus(<Name of TreeView Control>, <Full Element Name>)
WINDEVWindows MobileJavaAjax

Positioning on the last element of the TreeView control

To position on the last element of the TreeView control, use ..Occurrence:
<TreeView> = <TreeView>..Occurrence
Retrieving the element selected in the TreeView control
To retrieve:
  • the subscript of the selected element, use the direct reading of the element:
    Subscript = <TreeView Control>

    WEBDEV - Server codeWEBDEV - Browser code This feature is not available in WEBDEV.
  • the full path of the selected element, use TreeSelect:
    <Path> = TreeSelect(<TreeView Control>)

    WEBDEV - Browser code TreeSelect is available in Browser code.
  • the identifier of the selected element, use TreeIdentifier.
    WEBDEV - Browser code TreeIdentifier is not available in Browser code.
WLanguage properties associated with the elements of a TreeView control
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Using properties on an element of a TreeView control

Several WLanguage properties can be used on the elements of a TreeView control.
To find out the entire list of WLanguage properties that can be used on an element of a TreeView control, see Properties associated with a row of a TreeView control.
WINDEVWEBDEV - Server codeWindows MobileJavaAjax

Examples

Example: How to modify the color of an element in a TreeView control:
TREE_MyTreeView[5]..Color = LightRed
Example: How to modify the size of the font used for an element of a TreeView control:
TREE_MyTreeView["Recipe" + TAB + "Dessert" + TAB + "Pineapple"]..FontSize = 14
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment