private void btnReturnToMenu_Click(object sender, EventArgs e) { MenuForm frmMenu = new MenuForm(); //show the menu window frmMenu.Show(); //and hide the game window this.Hide(); }
//Returns user to main user menu private void btnReturn_Click_1(object sender, EventArgs e) { //creates a new menu form MenuForm frmMenu = new MenuForm(); //show the menu window frmMenu.Show(); //hides current level editor window this.Hide(); //hide the menu form }
//Creates a new Game Form public GameForm(MenuForm menu, string levelToLoad) { InitializeComponent(); //set the menu passed in as the menu form frmMenu = menu; //stores the name of the level that will be played levelToPlay = levelToLoad; this.DoubleBuffered = true;//This sets the form so it won't flicker when animating a lot of objects quickly //sets up necessary options for the form this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.ContainerControl | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor , true); UpdateStyles(); }