# Main Menu

In order to create the menu I first created a new form file and within it I placed a central play button. I then made changes to the program.cs to run the Main Menu initially.\
\
Main Menu Frm File

```csharp
using Fall2020_CSC403_Project.code;
using System;
using System.Windows.Forms;

namespace Fall2020_CSC403_Project
{
    internal class FrmMainMenu : Form
    {
        private PictureBox pictureBox1;
        private Button button1;

        public FrmMainMenu()
        {
            InitializeComponent();
        }
        private void InitializeComponent()
        {
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.button1 = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // pictureBox1
            // 
            this.pictureBox1.BackColor = System.Drawing.SystemColors.ControlDark;
            this.pictureBox1.Location = new System.Drawing.Point(-15, -17);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(1399, 779);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(434, 283);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(334, 141);
            this.button1.TabIndex = 1;
            this.button1.Text = "Play";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // FrmMainMenu
            // 
            this.ClientSize = new System.Drawing.Size(1256, 753);
            this.Controls.Add(this.button1);
            this.Name = "FrmMainMenu";
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);

        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            if (this.button1.Enabled)
            {
                this.Hide();
                FrmLevel openLevel = new FrmLevel();
                openLevel.ShowDialog();
            }
        }
    }
}

```

\
Once the central button is pressed the Menu hides and the FrmLevel is then shown.\
\
Old Menu:

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FG0A0zxyRJJ4OMbX6SJm4%2FScreenshot%2010_30_2023%2011_57_02%20AM.png?alt=media&#x26;token=3425e0c4-de40-4711-b372-1b3388f6ef37" alt=""><figcaption></figcaption></figure>

New Menu:\\

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FFKW2ddbBxzgulH5r2SzD%2FExplore%2011_15_2023%201_37_28%20PM.png?alt=media&#x26;token=8da1521c-2729-4f3f-8b92-e683ff75325f" alt=""><figcaption></figcaption></figure>
