Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make multiple instances of a form and its components ?

Status
Not open for further replies.

TrickyFt

Programmer
Jun 14, 2004
1
FR
i think the question is in the subject;)

i'm making an IRC client software and i want the user to be able to join some channels at the same time.
how to make multiple instances of this form and to be able to use their components ?

thanks.
 
This can get tricky depending on what the components on your form do. But to answer your question:

Code:
var
  FormList : TObjectList;
begin
  FormList := TObjectList.Create;
  FormList.Add(TMyForm.Create(nil));
  FormList.Add(TMyForm.Create(nil));
end;

That will give you two identical forms, from the one form definition. You can refer to your forms via the FormList objectlist, and by destroying the FormList object, you will also destroy the forms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top