C# - MouseDown event in Tree View Control
Here is a way to get the selected tree view node using C#. The snippet uses the X and Y co-ordinates to get the node
private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
Point p1 = new Point(e.X, e.Y);
TreeNode N1 = treeView1.GetNodeAt(p1) ;
MessageBox.Show(N1.Text);
}
2 comments:
Who ever posted this solution never tried it in a NET application because it doesn't work
Same problem
This solution works only on WPC. It doesn't work on a .NET application
Post a Comment