不太明白什么意思,是不是想清除窗体组件的信息,可以参考如下:procedure ClearContainer(Form: TForm); var ChildControl: TComponent; iLoop: Integer; begin for iLoop := Form.ComponentCount - 1 downto 0 do begin ChildControl := Form.Components[iLoop]; if ChildControl is TEdit then begin TEdit(ChildControl).Text := ''; TEdit(ChildControl).Color := clWindow; end else if ChildControl is TComboBox then begin TComboBox(ChildControl).Clear; TComboBox(ChildControl).Color := clWindow; end; end; end;
var
ChildControl: TComponent;
iLoop: Integer;
begin
for iLoop := Form.ComponentCount - 1 downto 0 do
begin
ChildControl := Form.Components[iLoop];
if ChildControl is TEdit then
begin
TEdit(ChildControl).Text := '';
TEdit(ChildControl).Color := clWindow;
end
else if ChildControl is TComboBox then
begin
TComboBox(ChildControl).Clear;
TComboBox(ChildControl).Color := clWindow;
end;
end;
end;