Programmatically click on the treeview node

  • Thread starter Thread starter Sanjin
  • Start date Start date
S

Sanjin

Is it possible to programmatically click (and make node checked also) on the
desired treeview (System.Windows.Forms.TreeView) node.

I.e. pseudo code:
myTreeview.Nodes[0].Click();

This code has to trigger the treeview AfterCheck event.

Thanks in advance
Sanjin
 
You set the .SelectedNode property. However, it sounds like
you've incorporated too much logic in the click event.

You should have a separate method that includes the logic
and is called in the click event.
 
Back
Top