Solved

How to focus a selected record in a TListView

Posted on 2004-09-16
5
274 Views
Last Modified: 2010-04-05
I'm not sure if Im missing something obvious here, but is there a way to focus a selected item in a listview, and actually move the scrollbars down to put it in the screen?

I've got ListView.Selected, and if I move my scroll bars down manually, I can see the record is selected.

Problem is I can't seem to get the listview to actually move down to the selected record and automatically display it by moving its own scrollbars.

What am I missing?
0
Comment
Question by:mikelittlewood
  • 3
5 Comments
 
LVL 11

Accepted Solution

by:
ZhaawZ earned 50 total points
ID: 12077397
use TListView().Selected.MakeVisible(false);
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12079914
supposing you wanted to make item 10 focused:

  ListView1.Items[10].MakeVisible(True);
  ListView1.Items[10].Selected:=True;
  ListView1.SetFocus
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12079920
if you only want it focused, but not selected, change

ListView1.Items[10].Selected:=True;
by this:
ListView1.Items[10].Focused:=True;

try with both and see the difference

best regards
EberSys
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 12083100
ah ha !

thanks guys
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12088620
???
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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