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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a form at runtime and add components

Status
Not open for further replies.

DaZZleD

Programmer
Oct 21, 2003
886
US
I created a temporary form at runtime and I would like to add components to it (like a progress bar) but I couldn't figure out how yet. I managed to create the temp form, customise it, also create the components, but they don't appear in the form (though they are created having as Owner the tempForm).

Any help is appreciated,
Alex
 
as usual... ten minutes after posting this question I've got the answer. Using the form's method called InsertComponent, one can add as many components to the form, the Owner specified in the Create statement of the component only describes who is responsible for destroying it.
 
Try setting the parent property

e.g.
(assumes "self" to be the form)

NewEdit:=TEdit.Create(Self); //As you say handles freeing
NewEdit.Parent:=Self; //Determines which component it will show on. Could be a panel instead of the form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top