Windows Phone Developers

Showing posts with label C# TreeView Controls. Show all posts
Showing posts with label C# TreeView Controls. Show all posts

Tuesday, February 17, 2009

How to get the selected node in tree view from MouseDown event using C#

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);

}

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon