TreeNodeMouseClickEventArgsとは? わかりやすく解説

TreeNodeMouseClickEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

NodeMouseClick イベントと NodeMouseDoubleClick イベントデータ提供します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Class TreeNodeMouseClickEventArgs
    Inherits MouseEventArgs
Dim instance As TreeNodeMouseClickEventArgs
public class TreeNodeMouseClickEventArgs :
 MouseEventArgs
public ref class TreeNodeMouseClickEventArgs
 : public MouseEventArgs
public class TreeNodeMouseClickEventArgs extends
 MouseEventArgs
public class TreeNodeMouseClickEventArgs extends
 MouseEventArgs
使用例使用例

TreeNodeMouseClickEventArgs イベント処理方法、および NodeMouseDoubleClick使用方法次のコード例示します。この例を実行するには、treeView1 という名前の TreeView が配置されている Windows フォームに、次のコード貼り付けます。次にサンプル実行しているシステムc:\ ディレクトリにあるファイルの名前を持つノードtreeView1作成しtreeView1NodeMouseDoubleClick イベントを、この例の treeView1_NodeMouseDoubleClick メソッド関連付けます。

' 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 'treeView1_NodeMouseDoubleClick

// 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.
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.");
        }
    }
継承階層継承階層
System.Object
   System.EventArgs
     System.Windows.Forms.MouseEventArgs
      System.Windows.Forms.TreeNodeMouseClickEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

TreeNodeMouseClickEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

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

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    node As TreeNode, _
    button As MouseButtons, _
    clicks As Integer, _
    x As Integer, _
    y As Integer _
)
Dim node As TreeNode
Dim button As MouseButtons
Dim clicks As Integer
Dim x As Integer
Dim y As Integer

Dim instance As New TreeNodeMouseClickEventArgs(node,
 button, clicks, x, y)
public TreeNodeMouseClickEventArgs (
    TreeNode node,
    MouseButtons button,
    int clicks,
    int x,
    int y
)
public:
TreeNodeMouseClickEventArgs (
    TreeNode^ node, 
    MouseButtons button, 
    int clicks, 
    int x, 
    int y
)
public TreeNodeMouseClickEventArgs (
    TreeNode node, 
    MouseButtons button, 
    int clicks, 
    int x, 
    int y
)
public function TreeNodeMouseClickEventArgs
 (
    node : TreeNode, 
    button : MouseButtons, 
    clicks : int, 
    x : int, 
    y : int
)

パラメータ

node

クリックされたノード

button

MouseButtons のメンバ1 つ

clicks

発生したクリック合計数。

x

クリック発生した位置x 座標

y

クリック発生した位置y 座標

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeMouseClickEventArgs クラス
TreeNodeMouseClickEventArgs メンバ
System.Windows.Forms 名前空間

TreeNodeMouseClickEventArgs プロパティ


TreeNodeMouseClickEventArgs メソッド


TreeNodeMouseClickEventArgs メンバ

NodeMouseClick イベントと NodeMouseDoubleClick イベントデータ提供します

TreeNodeMouseClickEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド TreeNodeMouseClickEventArgs TreeNodeMouseClickEventArgs クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

TreeNodeMouseClickEventArgs クラス
System.Windows.Forms 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TreeNodeMouseClickEventArgs」の関連用語

TreeNodeMouseClickEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TreeNodeMouseClickEventArgsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS