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 "OptionScreen": ns = new OptionScreen(); break; case "ScoreScreen": ns = new ScoreScreen(); break; } ns.Size = new Size(controlWidth, controlHeight); ns.Location = startCentre; tmp.Controls.Add(ns); ns.Focus(); }
public Form1() { InitializeComponent(); p2life1.Location = new Point(1409, 170); p2life2.Location = new Point(1345, 170); p2life3.Location = new Point(1281, 170); p1life1.Location = new Point(463, 170); p1life2.Location = new Point(526, 170); p1life3.Location = new Point(589, 170); p1_1 = p2life1; p1_2 = p2life2; p1_3 = p2life3; p2_1 = p1life1; p2_2 = p1life2; p2_3 = p1life3; // hide the mouse cursor Cursor.Hide(); // display the main menu Screens.MenuScreen mm = new Screens.MenuScreen(); // set the menu to display centre screen based on screen size defaults mm.Size = new Size(ScreenControl.controlWidth, ScreenControl.controlHeight); mm.Location = ScreenControl.startCentre; // add main menu screen to form this.Controls.Add(mm); }
public Form1() { InitializeComponent(); // hide the mouse cursor Cursor.Hide(); // display the main menu Screens.MenuScreen mm = new Screens.MenuScreen(); // set the menu to display centre screen based on screen size defaults mm.Size = new Size(ScreenControl.controlWidth, ScreenControl.controlHeight); mm.Location = ScreenControl.startCentre; // add main menu screen to form this.Controls.Add(mm); }
public Form1() { InitializeComponent(); //add to dictionary inventory.Add("AK-47", 0); inventory.Add("AWP", 0); inventory.Add("CZ75", 0); inventory.Add("Knife", 0); inventory.Add("FAMAS", 0); inventory.Add("Galil-AR", 0); inventory.Add("Glock-18", 0); inventory.Add("M4A4", 0); inventory.Add("MP7", 0); inventory.Add("MP9", 0); inventory.Add("Negev", 0); inventory.Add("Nova", 0); inventory.Add("P90", 0); inventory.Add("P2000", 0); inventory.Add("SG 553", 0); inventory.Add("UMP 45", 0); inventory.Add("USP-S", 0); // hide the mouse cursor //Cursor.Hide(); // display the main menu Screens.MenuScreen mm = new Screens.MenuScreen(); // set the menu to display centre screen based on screen size defaults mm.Size = new Size(ScreenControl.controlWidth, ScreenControl.controlHeight); mm.Location = ScreenControl.startCentre; // add main menu screen to form this.Controls.Add(mm); }