TreeNodeMouseClickEventArgs クラス

定義

NodeMouseClick イベントおよび NodeMouseDoubleClick イベントのデータを提供します。

public ref class TreeNodeMouseClickEventArgs : System::Windows::Forms::MouseEventArgs
public class TreeNodeMouseClickEventArgs : System.Windows.Forms.MouseEventArgs
type TreeNodeMouseClickEventArgs = class
    inherit MouseEventArgs
Public Class TreeNodeMouseClickEventArgs
Inherits MouseEventArgs
継承
TreeNodeMouseClickEventArgs

次のコード例では、 イベントを処理 NodeMouseDoubleClick する方法と を使用する方法を TreeNodeMouseClickEventArgs示します。 この例を実行するには、 という名前treeView1の を含む Windows フォームにコードをTreeView貼り付けます。 サンプルが実行されているシステムのディレクトリにあるc:\ファイルの名前を設定treeView1し、 のtreeView1_NodeMouseDoubleClicktreeView1イベントをNodeMouseDoubleClickこの例の メソッドに関連付けます。

    // If a node is double-clicked, open the file indicated by the TreeNode.
private:
    void InitialTreeView_NodeMouseDoubleClick(Object^ sender,
        TreeNodeMouseClickEventArgs^ e)
    {
        try
        {
            // Look for a file extension.
            if (e->Node->Text->Contains("."))
            {
                System::Diagnostics::Process::Start("c:\\" + e->Node->Text);
            }
        }
        // If the file is not found, handle the exception and inform the user.
        catch (System::ComponentModel::Win32Exception^)
        {
            MessageBox::Show("File not found.");
        }
    }
// If a node is double-clicked, open the file indicated by the TreeNode.
void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
    try
    {
        // Look for a file extension.
        if (e.Node.Text.Contains("."))
            System.Diagnostics.Process.Start(@"c:\" + e.Node.Text);
    }
        // If the file is not found, handle the exception and inform the user.
    catch (System.ComponentModel.Win32Exception)
    {
        MessageBox.Show("File not found.");
    }
}
' If a node is double-clicked, open the file indicated by the TreeNode.
Sub treeView1_NodeMouseDoubleClick(ByVal sender As Object, _
    ByVal e As TreeNodeMouseClickEventArgs) _
    Handles treeView1.NodeMouseDoubleClick

    Try
        ' Look for a file extension, and open the file.
        If e.Node.Text.Contains(".") Then
            System.Diagnostics.Process.Start("c:\" + e.Node.Text)
        End If
        ' If the file is not found, handle the exception and inform the user.
    Catch
        MessageBox.Show("File not found.")
    End Try

End Sub

コンストラクター

TreeNodeMouseClickEventArgs(TreeNode, MouseButtons, Int32, Int32, Int32)

TreeNodeMouseClickEventArgs クラスの新しいインスタンスを初期化します。

プロパティ

Button

マウスのどのボタンが押されたかを示す値を取得します。

(継承元 MouseEventArgs)
Clicks

マウス ボタンが押されて離された回数を取得します。

(継承元 MouseEventArgs)
Delta

マウス ホイールの回転回数を表す符号付きの数値に定数 WHEEL_DELTA の値を乗算した値を取得します。 マウス ホイールのノッチ 1 つ分が 1 移動量に相当します。

(継承元 MouseEventArgs)
Location

マウス イベント生成時のマウスの位置を取得します。

(継承元 MouseEventArgs)
Node

クリックされたノードを取得します。

X

マウス イベント生成時のマウスの x 座標を取得します。

(継承元 MouseEventArgs)
Y

マウス イベント生成時のマウスの y 座標を取得します。

(継承元 MouseEventArgs)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象