Selecting a List View Item

B

Brent Hoskisson

I can't figure out what I'm missing here. I set up a list
view control. As I load the form, I select one of the
items in the list view control:

lvwPrograms.Items(0).Selected = True

Everything is handled properly except that the item did
not highlight in the listview control. Do I need to
programatically highlight the item? If so how do I do
this?

Thanks
Brent
 
S

solex

Brent,

You should also use the EnsureVisible method of the ListViewItem. You may
need to move the code to the Activate Event if you are loading the form with
data before you show it.

Dan
 

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