TreeViewHitTestInfo.Location 속성

정의

TreeView 및 이 안에 들어 있는 노드를 기준으로 TreeView 컨트롤의 적중 테스트 위치를 가져옵니다.

public:
 property System::Windows::Forms::TreeViewHitTestLocations Location { System::Windows::Forms::TreeViewHitTestLocations get(); };
public System.Windows.Forms.TreeViewHitTestLocations Location { get; }
member this.Location : System.Windows.Forms.TreeViewHitTestLocations
Public ReadOnly Property Location As TreeViewHitTestLocations

속성 값

TreeViewHitTestLocations 값 중 하나입니다.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 Location 속성입니다. 이 예제를 실행 하려면 다음 코드를 포함 하는 Windows 폼에 붙여를 TreeView 라는 컨트롤 treeView1, 우는 TreeView 항목과 합니다. 했는지 treeview1 하며 MouseDown 폼에 대 한 이벤트와 연결 된는 HandleMouseDown 메서드.

void HandleMouseDown(object sender, MouseEventArgs e)
{
    TreeViewHitTestInfo info = treeView1.HitTest(e.X, e.Y);
    if (info != null)
        MessageBox.Show("Hit the " + info.Location.ToString());
}
Private Sub HandleMouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) _
    Handles Me.MouseDown, treeView1.MouseDown
    Dim info As TreeViewHitTestInfo = treeView1.HitTest(e.X, e.Y)
    If (info IsNot Nothing) Then
        MessageBox.Show("Hit the " + info.Location.ToString())
    End If

End Sub

적용 대상