我想在运行时添加一些组件。我使用的是C++ Builder XE 7和VCL。如何在运行时向类Form添加组件?这是可能的吗?
我想在运行时添加一些组件。我使用的是C++ Builder XE 7和VCL。如何在运行时向类Form添加组件?这是可能的吗?
__fastcall TForm2::TForm2(TComponent* Owner): TForm(Owner)
{
TButton* b = new TButton(this);
b->Parent = this;
b->Height = 100;
b->Width = 100;
b->Left = 0;
b->Top = 0;
b->Caption = "Testing";
b->Visible = true;
b->Enabled = true;
}