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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > 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) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「TreeNodeMouseClickEventArgs クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS