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. 이 예제를 실행하려면 TreeViewtreeView1 포함된 Windows Form에 코드를 붙여넣습니다. 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

생성자

Name Description
TreeNodeMouseClickEventArgs(TreeNode, MouseButtons, Int32, Int32, Int32)

TreeNodeMouseClickEventArgs 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
Button

누른 마우스 단추를 가져옵니다.

(다음에서 상속됨 MouseEventArgs)
Clicks

마우스 단추를 누르고 놓은 횟수를 가져옵니다.

(다음에서 상속됨 MouseEventArgs)
Delta

마우스 휠이 회전한 분리 횟수의 부호 있는 개수를 가져오고 WHEEL_DELTA 상수를 곱합니다. 분리는 마우스 휠의 한 단계입니다.

(다음에서 상속됨 MouseEventArgs)
Location

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

(다음에서 상속됨 MouseEventArgs)
Node

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

X

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

(다음에서 상속됨 MouseEventArgs)
Y

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

(다음에서 상속됨 MouseEventArgs)

메서드

Name Description
Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상