Solved

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

Posted on 2012-04-03
2
487 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Murray Brown
ID: 37803847
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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