The perpendicular critical fields of a superconducting film have been strongly enhanced by using a nanoengineered lattice of magnetic dots (dipoles) on top of the film. Magnetic-field-induced superconductivity is observed in these hybrid superconductor/ferromagnet systems due to the compensation of the applied field between the dots by the stray field of the dipole array. By switching between different magnetic states of the nanoengineered field compensator, the critical parameters of the superconductor can be effectively controlled.