PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
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 control). 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.
Windows Mobile

Direct operation

To handle an element of a TreeView control 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
Remark: 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
Windows Mobile

Initializing an element

To initialize an element found in a TreeView control, use TreeAdd.
During this addition, you can:
Windows Mobile

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
Windows Mobile

Selecting the element of row whose subscript is <Subscript>

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

    If the row is displayed in the TreeView control, the corresponding element is selected.
  • TreeSelectPlus:
    TreeSelectPlus(<Name of TreeView control>, <Full element name>)
Windows Mobile

Positioning on the last element of the TreeView control

To position on the last element of the TreeView control, use ..Count:
<Name of TreeView control> = <Name of TreeView control>..Count
Retrieving the element selected in the TreeView control
To retrieve:
  • the subscript of the selected element, use the direct reading of the element:
    Subscript = <Name of TreeView control>
  • the full path of the selected element, use TreeSelect:
    <Path> = TreeSelect(<Name of TreeView control>)
  • the identifier of the selected element, use TreeIdentifier.
WLanguage properties associated with the elements of a TreeView control
Windows Mobile

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.
Windows Mobile

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 version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment