Solved

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

Posted on 2012-04-03
2
472 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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

12 Experts available now in Live!

Get 1:1 Help Now