Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TreeView.NodeMouseClick Event

Occurs when the user clicks a TreeNode with the mouse.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

'Declaration
Public Event NodeMouseClick As TreeNodeMouseClickEventHandler

This event occurs when the user clicks any part of a tree node with the mouse, including the plus sign (+) or minus sign (-) that indicates whether the node is collapsed or expanded.

For more information about how to handle events, see Handling and Raising Events.

The following code example demonstrates how to handle the NodeMouseClick event.

Sub treeView1_NodeMouseClick(ByVal sender As Object, _
    ByVal e As TreeNodeMouseClickEventArgs) _
    Handles treeView1.NodeMouseClick

    textBox1.Text = e.Node.Text

End Sub 'treeView1_NodeMouseClick

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft