打印本文 打印本文  关闭窗口 关闭窗口  
BCB中派生VCL类及动态地创建控件
作者:佚名  文章来源:不详  点击数  更新时间:2008/4/18 14:38:34  文章录入:杜斌  责任编辑:杜斌

以下不完整例子为生成一个tmemo的派生类及动态地创建该vcl控件。 

class tmemoex : public tmemo 




extern tmemoex memoex; 

class tform1 : class tform 

public: 
tmemoex *memoex; 




void _fastcall tform1::formshow(tobject *sender) 

memoex=new tmemoex(this); 
memoex->parent=this; 



总之,遵循以下步骤即可: 
类定义; 
extern tmemoex memoex; 
tmemoex *memoex; 
memoex=new tmemoex(this); 
memoex->parent=this;
打印本文 打印本文  关闭窗口 关闭窗口