Solved

ListView Item Focus problem

Posted on 2008-10-14
4
657 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

710 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