BCB中派生VCL类及动态地创建控件
以下不完整的示例是生成tmemo的派生类和动态创建vcl控件。
类tmemoex:public TM emo
{
。
。
}
extern tmemoex memo ex;
class t form 1:class t form
{
public:
tmemoex * memo ex;
。
。
}
void _ fast call t form 1::form show(to object * sender)
{
memo ex = new tmemoex(this);
memo ex-> parent = this;
。
。
}
总之遵循以下步骤:
类定义;
extern tmemoex memo ex;
tmemoex * memo ex;
memo ex = new tmemoex(this);
memo ex-> parent = this;
0条评论