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.
 

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

Back
Top