NodeClick Event

Purpose

Occurs when a Node object is clicked.

Syntax

Sub TreeView_NodeClick(Node As Node)

Description

The NodeClick event passes a reference to the Node object that is clicked.

The standard Click event is generated when the user clicks any part of the TreeView control outside a node object. The NodeClick event is generated when the user clicks a particular Node object; the NodeClick event also returns a reference to a particular Node object which can be used to validate the Node before further action is taken.

The NodeClick event occurs before the standard Click event.

Example

Ocx TreeView tv1 = "", 10, 10, 150, 200

Local n

For n = 1 To 10 : tv1.Add , , Chr(64 + n) , "Node " & n : Next n

Do : Sleep : Until Me Is Nothing

 

Sub tv1_NodeClick(Node As Node)

MsgBox "Index: " & Node.Index & #13#10 & "Key: " & Node.Key & #13#10 & "Text: " & Node.Text

EndSub

See Also

TreeView

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