ListView Control

  • Thread starter Thread starter Gordon Marr
  • Start date Start date
G

Gordon Marr

Hello,

How do I select an Item in a ListView Control.

I would like to select the item based on the items text.

Thanks.
gord.
 
You can search for the Index of the item that you want to select and use this:

listView1.Items(Index).Selected = True
 
Gordon Marr said:
How do I select an Item in a ListView Control.

I would like to select the item based on the items text.

\\\
Dim lvi As ListViewItem
For Each lvi In Me.ListView1.Items
If lvi.Text = "Foo" Then
lvi.Selected = True
End If
Next lvi
///
 

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