BCB中派生VCL类及动态地创建控件 |
|
www.nanhushi.com 佚名 不详 |
以下不完整例子为生成一个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;
|
|
|
文章录入:杜斌 责任编辑:杜斌 |
|
上一篇文章: C++辅导:C/C++头文件一览 下一篇文章: C++数值类型转换方法 |
【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |
|
|