How do you set listview index to a specified index number.
I tried
ListView1.SelectedItem(3) and this is not correct.
> How do you set listview index to a specified index number.
>
> I tried
> ListView1.SelectedItem(3) and this is not correct.
Here's a couple of ways....
'========
Private Sub Form_Load()
With ListView1
Set .SelectedItem = .ListItems(3)
'or
Set .SelectedItem = .ListItems(YourKey)
'
'then...
.SelectedItem.EnsureVisible
End With
End Sub
'========

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Barbara - 31 Jan 2005 21:59 GMT
Than you
That was exactly what I needed.
Barbara
>-----Original Message-----
>> How do you set listview index to a specified index number.
[quoted text clipped - 15 lines]
>End Sub
>'========