Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Listview and selected

Posted on 2002-06-19
1
Medium Priority
?
290 Views
Last Modified: 2010-04-04
I like to have A listview, a TEdit and a TButton.

What I like to do is to be able to select (multiselect ) things in the listView and then type in a number in the
TEdit and push the button. What I like to happen is to
have the SUbitems[2] set to TEdit.Text for the selected items.

I have 2 questions though. When I try to do this the listview always lose the selection when I step into the EditBox or when I push the button... how can I prevent this to happen?

And how do I go through all Selected Items and set the Subitems[2] to TEdit.Text?
0
Comment
Question by:wqclatre
[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
1 Comment
 
LVL 3

Accepted Solution

by:
raidos earned 400 total points
ID: 7092062
This appears to work...

On the button click event.. add this..

Var
  Loop : Integer;
  Item : TListItem;
begin
  Item := ListView1.Selected;
  For Loop := 0 To ListView1.SelCount-1 Do Begin
    Item.SubItems[2] := Edit1.Text;
    Item := ListView1.GetNextItem(Item, sdAll, [isSelected]);
  End;
end;

about the selection loosing try setting the HideSelection property of the listview to false..

Regards
//raidos
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

670 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