How can a solenoid be used to magnetise a steel bar?
Place a steel bar inside a solenoid and let the constant current pass through it for some time. When the a constant current is flowing through the solenoid there is a constant magnetic field inside the solenoid and the steel bar get magnetized.