我的一个窗体中放入了PageControl,共8页tabsheet,每个tabsheet有3-4个GroupBox,在GroupBox上我放了若干个edit,现在我想通过一个按钮把所有的edit都清空,已知的办法如下,不过太多的GroupBox,我如何能简便点?
  for i := 0 to GroupBox1.ControlCount - 1 do
  begin
    if ( GroupBox1.Controls[ i ].ClassType = TEdit ) or
      ( GroupBox1.Controls[ i ].ClassType = TLabeledEdit ) then
    begin
      TEdit( GroupBox1.Controls[ i ] ).Clear;
    end;
  end;