Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 682
  • Last Modified:

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.
0
htgits
Asked:
htgits
  • 2
1 Solution
 
danaseamanCommented:
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
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.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now