BabbySay.Form1.Form1 C# (CSharp) Method

Form1() public method

public Form1 ( ) : System
return System
        public Form1()
        {
            this.InitializeComponent();
            int num = 0;
            for (int i = 0; i < 36; i++)
            {
                int num2 = 210 * num;
                switch (i - num * 5)
                {
                case 0:
                    num2 += 20;
                    break;
                case 1:
                    num2 += 80;
                    break;
                case 2:
                    num2 += 110;
                    break;
                case 3:
                    num2 += 170;
                    break;
                case 4:
                    num2 += 200;
                    break;
                }
                this.black_keys[i] = new KeyButton();
                this.black_keys[i].Width = 20;
                this.black_keys[i].Height = 200;
                this.black_keys[i].BackColor = Color.Black;
                this.black_keys[i].Location = new Point(num2, 0);
                this.black_keys[i].BringToFront();
                this.black_keys[i].Click += new EventHandler(this.key_click);
                this.black_keys[i].is_black = true;
                this.black_keys[i].number = i;
                this.black_keys[i].player = this.load_sound("b_" + i);
                base.Controls.Add(this.black_keys[i]);
                if ((i + 1) % 5 == 0)
                {
                    num++;
                }
            }
            for (int j = 0; j < 52; j++)
            {
                this.white_keys[j] = new KeyButton();
                this.white_keys[j].Width = 30;
                this.white_keys[j].Height = 300;
                this.white_keys[j].BackColor = Color.Ivory;
                this.white_keys[j].Location = new Point(30 * j, 0);
                this.white_keys[j].Click += new EventHandler(this.key_click);
                this.white_keys[j].is_black = false;
                this.white_keys[j].number = j;
                this.white_keys[j].player = this.load_sound("w_" + j);
                base.Controls.Add(this.white_keys[j]);
                this.white_keys[j].SendToBack();
            }
        }