Solved

Multiselect on Tlistview

Posted on 1998-02-23
2
261 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

16 Experts available now in Live!

Get 1:1 Help Now