Z zhshf Unregistered / Unconfirmed GUEST, unregistred user! 1999-07-15 #1 我自定义的一个从TPanel继承过来的控件TMyPanel, 把Caption设为空,但我把它放在Form上, 但Caption仍为MyPanel1. 怎么把Caption设为空?
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-07-16 #2 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;
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;