ListView Item Focus problem

I have a ListView in my app that has approx 1000 lines in it.
On an event, I want to find a particular item, then focus on it to save having to manually scroll to it.

I have tried the following without success:
        Dim iFocus as integer
        iFocus = 556
        listLoadedDetails.Focus()
        listLoadedDetails.Items(iFocus).Selected = True
        listLoadedDetails.Items(iFocus).Focused = True
        listLoadedDetails.Refresh()

For reference, the property "View" is set to "Details"

All help appreciated.
LVL 3
htgitsAsked:
Who is Participating?
 
danaseamanConnect With a Mentor Commented:
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
0
 
htgitsAuthor Commented:
Thank You for your suggestion ipaulino, but the accepted answer gave the best solution, providing one line of code to do exactly what i needed.
 
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
No problem ... you can combine the two methods.
I have mentioned "You can also ..."
0
All Courses

From novice to tech pro — start learning today.