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 ?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.