Expanded, FullPath Properties (Node)

Purpose

Returns or sets a value that determines whether a Node object in a TreeView control is currently expanded or collapsed.

Returns the fully qualified path of the referenced Node object in a TreeView control. When you assign this property to a string variable, the string is set to the FullPath of the node with the specified index.

Syntax

Node.Expanded[= boolean]

Node.FullPath

Description

You can use the Expanded property to programmatically expand a Node object. The following code has the same effect as double-clicking the first Node:

When a Node object is expanded, the Expand event is generated.

If a Node object has no child nodes, the property value is ignored.

The fully qualified path is the concatenation of the text in the referenced Node object's Text property with the Text property values of all its ancestors. The value of the PathSeparator property determines the delimiter.

Example

Ocx TreeView tv = "", 10, 10, 200, 400

tv.LineStyle = tvwRootLines

tv.Style = tvwPlusMinusText

tv.Add , , , "David"

tv.Add 1, tvwChild, , "Mary"

tv.Add 1, tvwChild, , "Harold"

tv.Add 1, tvwNext, , "Mildred"

tv.Add 4, tvwChild, , "Jennifer"

tv.Nodes(1).Expanded = True

tv(4).Expanded = True

Print AT(40, 1); "Harold's path: "; tv(3).FullPath

Do : Sleep  : Until Me Is Nothing

Remarks

A Node can be accessed in several different ways.

See Also

Node, TreeView, Expand

{Created by Sjouke Hamstra; Last updated: 05/10/2014 by James Gaite}