TComponent.ComponentCount
Note: This code does not save the form or data module to disk after the nonvisual components are moved.  If executed at runtime, the effect will not persist.var  I: Integer;
  Temp: TComponent;
begin
  for I := ComponentCount - 1 downto 0 do
  begin
    Temp := Components[I];
    if not (Temp is TControl) then
    begin
      RemoveComponent(Temp);
      DataModule2.InsertComponent(Temp);
    end;
  end;
end;
:三目运算符? 没有