Node Click Event in a Treeview Control:   Return to List

' Personally I prefer to use the MouseDown() event so that I can differentiate actions taken with right & left mouse buttons.

Dim xNod as Node
Private Sub Treeview1_NodeClick(ByVal xNod As Node)
Dim strFoundKey As String
Dim strDBaseKey As String
strFoundKey = xNod.Key
If Left(strFoundKey, 1) = "3" Then
    strDBaseKey = Right(strFoundKey, Len(strFoundKey) - 2)
    Select_Entry strDBaseKey
End If
End Sub

' All nodes in a Treeview have 2 basic properties:
    Node.Text -- The text displayed in the Treeview control
    Node.Key -- The assigned key -- used to attach children & perform other manipulations on the particular node.

See also:
Treeview ... Adding Nodes
Treeview ... Adding Root Node
Treeview ... Collapsing Nodes to Root Level
Treeview ... Complete Subprocedure for Collapsing Nodes
Treeview ... Counting Number of Nodes
Treeview ... Expanding All Nodes
Treeview ... Determing selected Node and Highlighting it
Treeview ... ChildNode Info of Selected Node
Treeview ... Text of Selected Node
Treeview ... Number of Children (in parens) appended to Text of Selected Node
Treeview ... Reacting to DragOver in a Treeview
Treeview ... Reacting to Drag and Drop
Treeview ... Repositioning Cursor to the Top of the Treeview



Note to Webmaster