Solved

ListView Item Focus problem

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

680 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