Application.CreateForm(TMainForm, MainForm);MainForm := TMainForm.Create(Application);这两种构造MainForm对象的方法有什么不同,
为什么用前一种方法时自己写的构造函数不起作用?构造函数如下:
constructor TMainForm.Create(AOwner : TComponent);
begin
Inherited Create(AOwner);
Center_X := (PaintArea.Width div 2) + PaintArea.Left;
Center_Y := (PaintArea.Height div 2) + PaintArea.Top;
BC_Radius := 150;
SC_Radius := 10;
BG_Color := clGreen;
BC_Color := clRed;
SC_Color := clYellow;
ColorBox_BG.Selected := BG_Color;
ColorBox_BC.Selected := BC_Color;
ColorBox_SC.Selected := SC_Color;
end;
为什么用前一种方法时自己写的构造函数不起作用?构造函数如下:
constructor TMainForm.Create(AOwner : TComponent);
begin
Inherited Create(AOwner);
Center_X := (PaintArea.Width div 2) + PaintArea.Left;
Center_Y := (PaintArea.Height div 2) + PaintArea.Top;
BC_Radius := 150;
SC_Radius := 10;
BG_Color := clGreen;
BC_Color := clRed;
SC_Color := clYellow;
ColorBox_BG.Selected := BG_Color;
ColorBox_BC.Selected := BC_Color;
ColorBox_SC.Selected := SC_Color;
end;
解决方案 »
- 请大家帮忙:关于读取网卡物理地址的代码。。 急呀,程序已经进入发布进段了
- 问: 一个窗体如果正在做很多事情的话,鼠标再去操作的话窗体就就白过来,像outlook之类没有这个问题,怎么处理的?
- jpeg文件头里,哪些是保存图象大小信息的呢?
- Realplay控件问题
- 请教高手一个小问题?
- 散分,庆祝小妹生日快乐!!!
- 如何处理屏幕的问题?
- 如何用ADOConnection连带密码的Access数据库?我连老是提示错误。急……
- Delphi7中为什么没有报表向导及报表控件?
- 问个关于比较编辑框的值的问题
- TColor 的值如何取出 RGB 的分量,另外系统定义的颜色又如何获取?
- 本人正在做一学生信息管理系统
难道不通过构造器?
不过是有点枯燥..