Solved

VB.net Treeview selection by mouse

Posted on 2006-10-30
2
350 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
2 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 125 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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