【问题标题】:How can I add components at run time in C++ Builder XE7如何在 C++ Builder XE7 运行时添加组件
【发布时间】:2014-12-20 22:54:54
【问题描述】:

我想在运行时添加一些组件。我使用 C++ Builder XE 7 和 vcl。如何在运行时将组件添加到 Form 类?那可能吗?

【问题讨论】:

标签: c++builder vcl c++builder-xe7


【解决方案1】:

我找到了解决方案。谢谢你。 这是一个例子:

__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;  
}

【讨论】:

  • 我已明确将您的问题标记为与上一个问题的重复,这意味着它应该被关闭(不回答)。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-09
  • 1970-01-01
  • 2023-04-07
  • 1970-01-01
  • 1970-01-01
  • 2020-03-09
相关资源
最近更新 更多