public static void Main() { using (Step3 frm = new Step3()) { frm.Show(); frm.InitializeGraphics(); Application.Run(frm); //triggers OnPaint event, which is main loop } Application.Exit(); }