Solved

VB.net check if TreeView node is at a position clicked on

Posted on 2012-04-03
2
475 Views
Last Modified: 2012-04-03
Hi

What code would I use to see if a TreeView node is present on MouseDown
0
Comment
Question by:murbro
2 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 500 total points
ID: 37803765
I think you would use TreeView.GetNodeAt method

    Private Sub TreeView1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseDown
        Dim n As TreeNode = TreeView1.GetNodeAt(e.X, e.Y)
        If n Is Nothing Then
            MsgBox("No node")
        Else
            MsgBox(n.Text)
        End If
    End Sub

Open in new window

TreeView.GetNodeAt Method
http://msdn.microsoft.com/en-us/library/1yxbz43s.aspx
0
 

Author Closing Comment

by:murbro
ID: 37803847
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now