In the figure we have an improved method of varying the voltage of a 7812 regulator. The circuit is from Radio Electronics from July 1984. It can be applied to other regulators.