Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB.net Treeview selection by mouse

Posted on 2006-10-30
2
Medium Priority
?
361 Views
Last Modified: 2008-03-17
When I Click on a treeview I only want a treenode selected if the node was clicked on it's Icon, it's Label, or the plus/minus symbol.

 All Those situations work, however when the treeview is clicked in a Blank Area, the treenode that is on the same Y-axis as where the mouse was clicked becomes the selected node.  How can I prevent that from happening and only have the treenode be the selected node when the Icon, Plus/minus, or label is selected??

0
Comment
Question by:OFGemini
[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 19

Accepted Solution

by:
VoteyDisciple earned 375 total points
ID: 17836830
I don't suppose setting FullRowSelect = False on the TreeView does it?  It's been a while since I've played extensively with a TreeView in .NET.

If not, you might try using the GetNodeAt() method to find the node at the point where the user clicked, though I'm guessing that would return a node for any locations that also result in selecting that node, so it wouldn't really gain you anything.
0
 

Author Comment

by:OFGemini
ID: 17837722
You're are right VoteyDisciple.  GetNodeAt() does exactly what I DO NOT want it to do.    

I made a change to my code and when I left click on the treeview it behaves as I want it to, but getNodeAt() does not.  I use getNodeAt to make a node the selected node if it is Right-Clicked.  I did that in my treeview mousedown event.  

Now I need to figure out how to Get the right click working correctly.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

636 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