private Form CreateForm(string name) { var RawForm = new Form { Text = name, Visible = true, WindowState = FormWindowState.Maximized }; RawForm.KeyPreview = true; RawForm.KeyDown += (sender, args) => { if (args.KeyCode == Keys.Escape) { Application.Exit(); } }; Forms.AddOrUpdate(name, RawForm, (s, form) => RawForm); return(RawForm); }