c++ builder XE4, 10.2 Tokyo > 動的生成 > TLabelを動的に生成する


動作環境
C++ Builder XE4 on Windows 7 pro
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/26)

TLabelをフォームデザインでなく、コードで生成したい。

参考
https://groups.google.com/forum/#!topic/delphicbuilder-ml-archive/h3lxsfy1ABI

void __fastcall TPressuresForm::Button2Click(TObject *Sender)
{
    TLabel *work;

    work = new TLabel( this );
    work->Name = L"L_test";
    work->Height = 20;
    work->Width = 100;
    work->Left = 10;
    work->Top = 5;
    work->Caption = L"TEST LABEL";
    work->Visible = true;
    work->Parent = this;
}