谁知道怎么刷新窗体吗。。有一句话就能做到的吗。。我不想一个一个控件去清理他们啊。。在线等了。。给分。。

解决方案 »

  1.   

    不太明白什么意思,是不是想清除窗体组件的信息,可以参考如下: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;