use*_*809 4 components runtime c++builder
非常基本的C++ Builder问题.我想在运行时创建一个TButton.我原以为下面的代码会这样做,但我看到表单上没有按钮:
__fastcall TForm2::TForm2(TComponent* Owner): TForm(Owner)
{
TButton* b = new TButton(this);
b->Height = 100;
b->Width = 100;
b->Left = 0;
b->Top = 0;
b->Caption = "Testing";
b->Visible = true;
b->Enabled = true;
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!