TreeViewHitTestInfo.Location Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
One of the TreeViewHitTestLocations values.
Examples
The following code example demonstrates how to use the Location property. To run this example, paste the following code into a Windows Form that contains a TreeView control named treeView1
, and populate the TreeView with items. Ensure that treeview1
and the MouseDown event for the form are associated with the HandleMouseDown
method.
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
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.