break一下嘛
难道你没发现
function TComponent.FindComponent(const AName: string): TComponent;
var
I: Integer;
begin
if (AName <> '') and (FComponents <> nil) then
[red]for I := 0 to FComponents.Count - 1 do[/red] begin
Result := FComponents;
if SameText(Result.FName, AName) then Exit;
end;
Result := nil;
end;