Solved

ListView Item Focus problem

Posted on 2008-10-14
4
655 Views
Last Modified: 2013-12-26
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
Comment
Question by:htgits
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 250 total points
ID: 22711511
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22712277
0
 
LVL 3

Author Comment

by:htgits
ID: 22715299
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
 
LVL 48

Expert Comment

by:jpaulino
ID: 22715330
No problem ... you can combine the two methods.
I have mentioned "You can also ..."
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question