TreeView.NodeMouseDoubleClick イベント
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As TreeView Dim handler As TreeNodeMouseClickEventHandler AddHandler instance.NodeMouseDoubleClick, handler
public: event TreeNodeMouseClickEventHandler^ NodeMouseDoubleClick { void add (TreeNodeMouseClickEventHandler^ value); void remove (TreeNodeMouseClickEventHandler^ value); }


TreeNodeMouseClickEventArgs イベントの処理方法、および NodeMouseDoubleClick の使用方法を次のコード例に示します。この例を実行するには、treeView1 という名前の TreeView が配置されている Windows フォームに、次のコードを貼り付けます。次に、サンプルを実行しているシステムの c:\ ディレクトリにあるファイルの名前を持つノードを treeView1 に作成し、treeView1 の NodeMouseDoubleClick イベントを、この例の 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."); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTreeView.NodeMouseDoubleClick イベントを検索する場合は、下記のリンクをクリックしてください。

- TreeView.NodeMouseDoubleClick イベントのページへのリンク