Solved

TListView preventing unselecting all

Posted on 2004-03-31
2
239 Views
Last Modified: 2010-04-05
Hi all,

I need a ListView that always has a selection. The problem is that when the user clicks the blank area of the ListView (the area that remains below all items when the ListView is large enough) all items get deselcted. I want the last item selected to remain selected. The ListBox already works this way but I can't get the ListView to behave this way.

Regards Jacco
0
Comment
Question by:Jacco
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 10729810
maybe this way?

procedure TForm1.ListView1Click(Sender: TObject);
begin
  if not assigned(listview1.Selected) then
  begin
    listview1.Selected := listview1.Items[listview1.Items.Count-1];
    //maybe also needed
    listview1.ItemFocused := listview1.Selected;
  end;
end;


meikl ;-)
0
 
LVL 10

Author Comment

by:Jacco
ID: 10730066
Thanks Meikl!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

22 Experts available now in Live!

Get 1:1 Help Now