tree view

  • Thread starter Mohammed Abdel-Razzak
  • Start date
M

Mohammed Abdel-Razzak

Dear sirs
I`ve added a tree view to one of my forms in the project
I want to know how when I double click on a specific node
an event happen
How can I do that??!!!

thanks Mohammed
 
S

Shakir Hussain

Mohammed,

There is no direct event for double click of node.

Try this

private void treeView1_DoubleClick(object sender, System.EventArgs e)
{
//get client points
Point p = treeView1.PointToClient(new Point (Cursor.Position.X
,Cursor.Position.Y));
//get tree node for that point
TreeNode pNode = treeView1.GetNodeAt(p.X,p.Y);
//if valid node process
if(pNode != null)
{
//do something
}
}

Shak.
 

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