auto selecting the 1st item in a list view...

B

Brad Pears

As part of my vb.net 2005 application I would like to automatically select
the very first item (index 0) in a listview containing menu items. That way
the the listviews "afterselect" event would fired - hence running the code
pertaining to that first menu item.

How can I do this in code?

Thanks, Brad
 
B

Brad Pears

I am sorry - I completlely mislead you. It's a treeview NOT a listview.
there is not a "selectedindex" property in a treeview control...

Help!

Brad
 
G

Guest

TreeView1.SelectedNode = 0

Brad Pears said:
I am sorry - I completlely mislead you. It's a treeview NOT a listview.
there is not a "selectedindex" property in a treeview control...

Help!

Brad
 
B

Brad Pears

One other quick question.... When the treeview item node is selected
programatically in this fashion, the node does not appear highlited as it
would when you click on it with the mouse. Other than actually setting a
background colour for the node, can you think of an easy way to get this to
happen? I want the user to see which item has been automatically selected...

Thanks, Brad
 

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