Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Treeview - How to simulate user click on a node?

If I click on a node in the treeview, it is highlighted. However, I would like the first node to be highlighted by default at Form activate before the user clicks any node. How do I achieve this?
0
JoeLalor
Asked:
JoeLalor
1 Solution
 
sazhagianambiCommented:
Hi

TreeView1.Nodes(1).Selected = True

Normally Root's Index is 1
This is used to select the First Node Of Tree.

Cheers,
Nambi
0
 
xThorxCommented:
Or why don't you just put:
treeview1.setfocus
in form_activate ?
0
 
sazhagianambiCommented:

SetFocus Method also Works.

Place this Into Form Load Or Activate,
TreeView1.Nodes(1).Selected = True

But Using this u can able to set focus any Item u want

Nambi
0
 
CleanupPingCommented:
JoeLalor:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
DanRollinsCommented:
Moderator, my recommended disposition is:

    Accept sazhagianambi's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now