以下不完整例子为生成个TMemo派生类及动态地创建该VCLControl控件
Class TMemoEx : public TMemo
{
.
.
}
extern TMemoEx memoex;
Class TForm1 : Class TForm
{
public:
TMemoEx *MemoEx;
.
.
}
void _fastcall TForm1::FormShow(TObject *Sender)
{
MemoEx= TMemoEx(this);
MemoEx->Parent=this;
.
.
}
总的遵循以下步骤即可:
类定义;
extern TMemoEx memoex;
TMemoEx *MemoEx;
MemoEx= TMemoEx(this);
MemoEx->Parent=this;
最新评论