Solved

ListView Item Focus problem

Posted on 2008-10-14
4
647 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now