我有两种形式,一种是主要的和其他的遗传形式main.Lets说我有在主窗体上的函数:如何继承在运行时创建的控件?
procedure FormMain.CreateButton;
begin
with TsButton.Create(Self) do begin
Width := 31;
Height := 31;
Left := 31;
Top := 31;
Visible := true;
Parent := Self;
end;
end;
通常在主窗体上一切都应该继承的形式,但这种是我所做的:
我从mainForm调用CreateButton,但该按钮只在主窗体上。
是否有可能继承该按钮?
呀 - 把它放在那里,但可使它不可见。只需在需要时将其视为可见。 – 2009-08-14 15:05:42