AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control TreeView
  • 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 an element at row
  • 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
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
This help page explains how to handle the elements of a TreeView control either directly or via the WLanguage functions.
You can:
WEBDEV - Código Navegador 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 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:
"<Root name>" + 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 - Código ServidorJavaAjax

Direct operation

To manipulate an element of a TreeView control directly (with the WLanguage properties for example), two notations are available:
  • Operation performed via the index of the element:
    Just use the following notation: <Tree Field> [ <Item Index>].
    Please note: The specified indices only take into account visible elements..
    Example: Changing 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:
    Just use the following notation: <Tree Field> [ <Element Path>].
    The path of the element is a character string in the following format:
    "<Root name>" + TAB + ["<Name of 1st node>" + TAB + ...
    ["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>"
    Example: Changing the color of the "Pineapple" element.
    TREE_MyTreeView["Recipe" + TAB + "Dessert" + TAB + "Pineapple"].Color = LightRed
Note: It is also possible to use the following notation to designate the current element of a TreeView control:
MySelf[TreeSelect(MySelf)]
Initializing an element in a TreeView control
WINDEVWEBDEV - Código ServidorJavaAjax

Initializing an element

To initialize an element found in a TreeView control, use TreeAdd.
During this addition, you can:
WINDEVWEBDEV - Código ServidorJavaAjax

Associating a tooltip with an element

To associate a tooltip with an element in a Treeview control, you can use:
If the element's tooltip text is not specified, the text displayed will be that of the TreeView control's tooltip (if it exists).
Reminder: By default, the tooltips associated with the various fields are displayed.. To specify whether the tooltips must be displayed or not, use ShowToolTip.
Selecting an element in a TreeView control
WINDEVWEBDEV - Código ServidorJavaAjax

Selecting an element at row <Index>

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

    If the row is displayed in the TreeView control, the corresponding element is selected.
  • the TreeSelectPlus function:
    TreeSelectPlus(<TreeView control>, <Full element name>)
WINDEVJavaAjax

Positioning on the last element of the TreeView control

To set the position on the last element of the TreeView control, use the Count property:
<TreeView control> = <TreeView control>.Count
Retrieving the element selected in the TreeView control
To retrieve:
  • the index of the selected element, use the direct reading of the element:
    Index = <TreeView control>
    WEBDEV - Código ServidorWEBDEV - Código Navegador This feature is not available in WEBDEV.
  • the full path of the selected element, use TreeSelect:
    <Path> = TreeSelect(<TreeView control>)
    WEBDEV - Código Navegador TreeSelect is available in Browser code.
  • the identifier of the selected element, use TreeIdentifier.
    WEBDEV - Código Navegador TreeIdentifier is not available in Browser code.
WLanguage properties associated with the elements of a TreeView control
WINDEVWEBDEV - Código ServidorJavaAjax

Using properties on an element of a TreeView control

Several WLanguage properties can be used on the elements of a TreeView control.
For a complete 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 - Código ServidorJavaAjax

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
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 04/10/2024

Señalar un error o enviar una sugerencia | Ayuda local