By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,214 Members | 1,496 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,214 IT Pros & Developers. It's quick & easy.

small treeview question

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.