static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var connectToServerForm = new ConnectToServerForm(); Application.Run(connectToServerForm); if (connectToServerForm.MDSController != null) { Application.Run(new MainForm(connectToServerForm.MDSController)); } }