自定义控件的CAPTION(100分)

Z

zhshf

Unregistered / Unconfirmed
GUEST, unregistred user!
我自定义的一个从TPanel继承过来的控件TMyPanel,
把Caption设为空,但我把它放在Form上,
但Caption仍为MyPanel1.
怎么把Caption设为空?
 
constructor TMyPanel.Create(AOwner: TComponent);
begin
inherited create(AOwner);
Caption := '';
end;
不行吗?
如果不行:
class TMyPanel = class(TPanel)
private
....
protected
procedure SetParent(AParent: TWinControl); override;
public
....
published
...
end;

procedure TMyPanel.SetParent(AParent: TWinControl);
begin
inherited SetParent(AParent);
Caption := '';
end;
 
接受答案了.
 

Similar threads

顶部