TreeView.NodeMouseClick 事件

定义

当用户使用鼠标单击 TreeNode 时发生。

public:
 event System::Windows::Forms::TreeNodeMouseClickEventHandler ^ NodeMouseClick;
public event System.Windows.Forms.TreeNodeMouseClickEventHandler NodeMouseClick;
public event System.Windows.Forms.TreeNodeMouseClickEventHandler? NodeMouseClick;
member this.NodeMouseClick : System.Windows.Forms.TreeNodeMouseClickEventHandler 
Public Custom Event NodeMouseClick As TreeNodeMouseClickEventHandler 

事件类型

示例

下面的代码示例演示如何处理 NodeMouseClick 事件。

private:
    void InitialTreeView_NodeMouseClick(Object^ sender,
        TreeNodeMouseClickEventArgs^ e)
    {
        displayNodes->Text = e->Node->Text;
    }
void treeView1_NodeMouseClick(object sender,  
    TreeNodeMouseClickEventArgs e)
{
    textBox1.Text = e.Node.Text;
}
Sub treeView1_NodeMouseClick(ByVal sender As Object, _
    ByVal e As TreeNodeMouseClickEventArgs) _
    Handles treeView1.NodeMouseClick

    textBox1.Text = e.Node.Text

End Sub

注解

当用户使用鼠标单击树节点的任何部分时,将发生此事件,包括加号 (+) 或减号 (- 指示节点是折叠还是展开的) 。

有关如何处理事件的详细信息,请参阅 处理和引发事件

适用于

另请参阅