TreeNodeMouseClickEventArgs TreeNodeMouseClickEventArgs TreeNodeMouseClickEventArgs TreeNodeMouseClickEventArgs Class

정의

NodeMouseClickNodeMouseDoubleClick 이벤트에 대한 데이터를 제공합니다.Provides data for the NodeMouseClick and NodeMouseDoubleClick events.

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
상속
TreeNodeMouseClickEventArgsTreeNodeMouseClickEventArgsTreeNodeMouseClickEventArgsTreeNodeMouseClickEventArgs

예제

다음 코드 예제에서는 처리 하는 방법에 설명 합니다 NodeMouseDoubleClick 이벤트 및 사용 방법에는 TreeNodeMouseClickEventArgs합니다.The following code example demonstrates how to handle the NodeMouseDoubleClick event and how to use the TreeNodeMouseClickEventArgs. 이 예제를 실행 하려면 코드를 포함 하는 Windows 폼에 붙여 넣습니다를 TreeView 라는 treeView1합니다.To run this example, paste the code into a Windows Form that contains a TreeView named treeView1. 채우기 treeView1 에 있는 파일의 이름으로는 c:\ 샘플을 실행 중인 시스템의 디렉터리와 연결 합니다 NodeMouseDoubleClick 이벤트를 treeView1 사용 하 여를 treeView1_NodeMouseDoubleClick 이 예제의 메서드.Populate treeView1 with the names of files located in the c:\ directory of the system the sample is running on, and associate the NodeMouseDoubleClick event of treeView1 with the treeView1_NodeMouseDoubleClick method in this example.

    // 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(TreeNode, MouseButtons, Int32, Int32, Int32) TreeNodeMouseClickEventArgs(TreeNode, MouseButtons, Int32, Int32, Int32) TreeNodeMouseClickEventArgs(TreeNode, MouseButtons, Int32, Int32, Int32)

TreeNodeMouseClickEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the TreeNodeMouseClickEventArgs class.

속성

Button Button Button Button

누른 마우스 단추를 나타내는 값을 가져옵니다.Gets which mouse button was pressed.

(Inherited from MouseEventArgs)
Clicks Clicks Clicks Clicks

마우스 단추를 눌렀다 놓은 횟수를 가져옵니다.Gets the number of times the mouse button was pressed and released.

(Inherited from MouseEventArgs)
Delta Delta Delta Delta

마우스 휠의 회전 수를 나타내는 부호 있는 숫자에 WHEEL_DELTA 상수를 곱한 값을 가져옵니다.Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. 회전이란 마우스 휠을 한 번 돌리는 것입니다.A detent is one notch of the mouse wheel.

(Inherited from MouseEventArgs)
Location Location Location Location

마우스 이벤트를 생성하는 동안 마우스의 위치를 가져옵니다.Gets the location of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)
Node Node Node Node

클릭된 노드를 가져옵니다.Gets the node that was clicked.

X X X X

마우스 이벤트를 생성하는 동안 마우스의 x 좌표를 가져옵니다.Gets the x-coordinate of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)
Y Y Y Y

마우스 이벤트를 생성하는 동안 마우스의 y 좌표를 가져옵니다.Gets the y-coordinate of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)

메서드

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

적용 대상