Solved

Multiselect on Tlistview

Posted on 1998-02-23
2
265 Views
Last Modified: 2010-04-04
I'm using TListView in an application and I am having problems using multiselection.

I have a Tlist of n listviews. When creating the second listview I get a RT error "A component called _1 already exists" ???
0
Comment
Question by:spaceboy
2 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1359698
When creating new, Do you give it a name?
0
 

Accepted Solution

by:
bijoyn earned 200 total points
ID: 1359699
Hello SpaceBoy,

I ma not sure of what u are doing, but try this code. Maybe it will solve your problem.

-------------
type
  ListRecord = record
    FListView   :  TListView;
  end;

  PTRToList  = ^ListRecord;

  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
      FList          :  TList;
      Ptr_ListView   :  PTRToList;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
var
   i_count  :  Integer;
begin
   FList := TList.Create;
   for i_count := 0 to 10 do
   begin
      New(Ptr_ListView);
      FList.Add(Ptr_ListView);
   end;
   ShowMessage(Inttostr(Flist.count));
end;

end.
-------------------

I hope it solves your problem.

Bijoy
0

Featured Post

Industry Leaders: 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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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