Solved

Enable components at run-time

Posted on 1998-09-04
2
136 Views
Last Modified: 2010-04-04
With Dephi3 or 4,
how to enable components at run-time (dynamic) ?
In place of taking components and placing them to a form, i
want to initialize them when my program run (ONactivate).
For example, how to initialize +- 100 instances of Tshape
components and assign a different name to each :

Shape1
Shape2
...

Sorry for my English, but i am french.

Thanks everybody.
0
Comment
Question by:lgc5800
[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
2 Comments
 
LVL 2

Accepted Solution

by:
rene100 earned 200 total points
ID: 1338639
hi

every component has a create method, which you have to use
for a tshape:

var
shape1: TShape; //shape1 ist the name
begin
shape1:=Tshape.create(self);
shape1.left:=0;
shape1.top:=0;
shape1.parent:=self; //self is the current form, if want a other
                     //form, just put in the name of it  
shape1.visible:=true;
end;

regards
rene

0
 

Author Comment

by:lgc5800
ID: 1338640
Thanks rene100, i have testing your solution
with drag and drop implement and all works good.

To see you later.

Jones.
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

Suggested Solutions

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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