473,378 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

small treeview question

I have the following bit of code, to handle an event when someone clicks on a
treenode

void myTreeview_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeView trv = (TreeView)sender;
TreeNode node = trv.GetNodeAt(new Point(e.X, e.Y));
//code specific for that treenode
}
the problem is with the GetNodeAt() method, that when i click on the
whitespace in front of the actual treenode, he also finds that treenode and
the same code actually runs. Anybody know a solution for this
Jan 24 '07 #1
1 1118
Hi,

Can't you use BeforeSelect/AfterSelect events for that?

--
Stoitcho Goutsev (100)

"Cé" <C@discussions.microsoft.comwrote in message
news:2C**********************************@microsof t.com...
>I have the following bit of code, to handle an event when someone clicks on
a
treenode

void myTreeview_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs
e)
{
TreeView trv = (TreeView)sender;
TreeNode node = trv.GetNodeAt(new Point(e.X, e.Y));
//code specific for that treenode
}
the problem is with the GetNodeAt() method, that when i click on the
whitespace in front of the actual treenode, he also finds that treenode
and
the same code actually runs. Anybody know a solution for this

Jan 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter | last post by:
Hello Thanks for reviewing my question. I would like to know how can I programmatically select a node Thanks in Advanc Peter
3
by: Tom | last post by:
Sorry... new to this. I trying to figure out how to do a page redirect when someone clicks a treeview node. Does someone have a code snippet for this?
13
by: André Nogueira | last post by:
Hi there. I know you can view a node's fullpath property, but is it posible to select a node using its path? Like, tell the treeview that the node that should be selected is the node with the...
3
by: Gerhard | last post by:
I have the following code in an .net 2.0 project: <asp:Panel Runat="server" id="pnlNavigation" CssClass="pnlNavigation" Width="165px"> <asp:TreeView ID="TreeView1" runat="server"...
1
by: Sam | last post by:
Hi, On my main form in my MDI application, I have two treeview, one on the right, which is actually a UserControl inherited from Treeview, and the other on the left. When I click on a node in...
1
by: Daves | last post by:
Sorry folks but I will be reposting this question from 6/5 until someone gives me an answer - the question is very easy and so ought the answer to be. I really need the answer! ------- I'm...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
7
by: Joe Cool | last post by:
Let's say I have a Treeview control on a form. Each leaf node in the Treeview has a ContextMenuStrip, each with one ToolStripMenuItem, and all ToolStripMenuItems Click event is handled by a comment...
9
by: auntiejack56 | last post by:
Hi, I've got a treeview, and I want to display the node text property that I have a) clicked on or b) highlighted using the up or down arrows
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.