TreeNodeMouseClickEventArgs 클래스

정의

NodeMouseClickNodeMouseDoubleClick 이벤트에 대한 데이터를 제공합니다.

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합니다. 이 예제를 실행 하려면 코드를 포함 하는 Windows 폼에 붙여 넣습니다를 TreeView 라는 treeView1합니다. 채우기 treeView1 에 있는 파일의 이름으로는 c:\ 샘플을 실행 중인 시스템의 디렉터리와 연결 합니다 NodeMouseDoubleClick 이벤트를 treeView1 사용 하 여를 treeView1_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 상수를 곱한 값을 가져옵니다. 회전이란 마우스 휠을 한 번 돌리는 것입니다.

(다음에서 상속됨 MouseEventArgs)
Location

마우스 이벤트를 생성하는 동안 마우스의 위치를 가져옵니다.

(다음에서 상속됨 MouseEventArgs)
Node

클릭된 노드를 가져옵니다.

X

마우스 이벤트를 생성하는 동안 마우스의 x 좌표를 가져옵니다.

(다음에서 상속됨 MouseEventArgs)
Y

마우스 이벤트를 생성하는 동안 마우스의 y 좌표를 가져옵니다.

(다음에서 상속됨 MouseEventArgs)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상