for (int i = 1; i <= 5; i++) {
TButton *newButton = new TButton(Form1);
newButton->Parent = Form1;
newButton->Caption = "Button " + IntToStr(i);
// Set other properties, such as Top, Left...
}
Something like this will work, of course it depends on the component, some require extra things in their constructor.
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.