ListView Object

ListView obect display a number of records.
how can i select ,for example last record ,in the program
(without mouse or keyboard)
I can't find any method which can do it in the listview.
Thanks .
VadimkaAsked:
Who is Participating?
 
Mohammed NasmanSoftware DeveloperCommented:
to select last item in the list view

  ListView1.ListItems(ListView1.ListItems.Count).Selected = True
  ListView1.SetFocus
0
 
hongjunCommented:
Try this

Dim i As Integer

i = 2 ' 2 means second record
ListView1.ListItems(i).Selected = True



hongjun
0
 
VindaCommented:
lIndex = ListView1.ListItems.Count

ListView1.ListItems(lIndex).Selected = True
ListView1.ListItems(lIndex).EnsureVisible

This should solve the problem
0
 
hongjunCommented:
Vadimka, any reply?

hongjun
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.