我定义了一个继承与TPanel的控件,为什么在重载的Create里修改一些如Caption、Width等属性不起作用?
TMyPanel = class(TPanel)
……
public
constructor Create(AOwner: TComponent); override;
……
end;
……
constructor TDockPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Caption:='';//这句在设计时和运行时都无效果
Width:=10;//这句只是在设计时起作用,运行时无效果
end;
TMyPanel = class(TPanel)
……
public
constructor Create(AOwner: TComponent); override;
……
end;
……
constructor TDockPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Caption:='';//这句在设计时和运行时都无效果
Width:=10;//这句只是在设计时起作用,运行时无效果
end;
解决方案 »
- 这是否真实?
- SendMessage(tempHandle,WM_CLOSE,0,0); 这句关不掉QQ,是为什么?谢谢!!
- {{{{{{{ 请问用什么方法可以这样写入一个文件? }}}}}}}
- CORBAConnection,在delphi7.0的哪儿啊,我怎么找不到啊
- 图像二值化的问题:请问怎样用双峰法对灰度直方图进行二值化
- 请问,当输入完以后按回车就能执行的响应事件是什么?
- 请问怎样通过WINDOWS消息传递比较大的数据在两个程序之间
- 窗体的 FormState 出界?急求解决办法 - 100 分
- listview能否设定垂直滚动条?怎样设?
- 如何得到当前文件所在的路径(64分)
- 各位大哥,给看看图形问题,急死了!
- 为什么98下面接不上oracle8
var
ChangeText: Boolean;
begin
ChangeText := (csSetCaption in ControlStyle) and
not (csLoading in ComponentState) and (Name = Text) and
((Owner = nil) or not (Owner is TControl) or
not (csLoading in TControl(Owner).ComponentState));
inherited SetName(Value);
if ChangeText then Text := Value;
end;
这些代码可以帮您明白