TreeView Node click

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

I'd like to implement a node click custom code. How can I attach my code to
the node click?
I am developing in C#.

Thanks
 
There is an event "Click" for the treeview...You can add this event, and
call it.
You can choose this event from the "Events" windows in visual studio.net
 
Mark

There is an AfterSelect event on the TreeView which is fired whenever a different node is selected in the tree. You can also determine what happened to raise the event from the passed in arguments so, something like this should work whenever a node is clicke

if ( e.Action == TreeViewAction.ByMouse

MessageBox.Show( "Clicked" )
}
 
Back
Top