public static void changeScreen(UserControl current, string next) { //tmp is set to the form that this control is on Form tmp = current.FindForm(); tmp.Controls.Remove(current); UserControl ns = null; switch (next) { case "GameScreen": ns = new GameScreen(); break; case "InstructionScreen": ns = new InstructionScreen(); break; case "MenuScreen": ns = new MenuScreen(); break; case "LostScreen": ns = new WinScreen(); break; case "WinScreen": ns = new LostScreen(); break; } ns.Size = new Size(controlWidth, controlHeight); ns.Location = startCentre; tmp.Controls.Add(ns); ns.Focus(); }
private void Start() { instance = this; }