共用方式為


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

備註

當使用者使用滑鼠按一下樹狀節點的任何部分時,就會發生此事件,包括加號 () + 或減號 () - ,指出節點是否折迭或展開。

如需如何處理事件的詳細資訊,請參閱 處理和引發事件

適用於

另請參閱