small treeview question

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top