Share via


TreeViewHitTestInfo.Location Özellik

Tanım

Denetimdeki TreeView isabet testinin konumunu, içerdiği ve düğümlerine TreeView göre alır.

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

Özellik Değeri

Değerlerden TreeViewHitTestLocations biri.

Örnekler

Aşağıdaki kod örneği özelliğinin Location nasıl kullanılacağını gösterir. Bu örneği çalıştırmak için, aşağıdaki kodu adlı treeView1denetimi içeren bir TreeView Windows Formuna yapıştırın ve öğesini öğelerle doldurunTreeView. Formun treeview1 ve olayının MouseDown yöntemiyle ilişkilendirildiğinden HandleMouseDown emin olun.

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

Şunlara uygulanır