コード例 #1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            PP                    = new PlayPanel(4, 4);
            PP.Location           = new Point(0, stripMenu.Height);
            PP.PlayState_Changed += new PlayPanel.PlayState_Changed_Del(PP_PlayState_Changed);

            this.Controls.Add(PP);
            //this.ActiveControl = PP;

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Size            = PP.Size;
            this.Height          = PP.Height + stripMenu.Height;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
        }
コード例 #2
0
 void PP_PlayState_Changed(PlayPanel sender, PlayStates playstate)
 {
     if (playstate == PlayStates.GAMEOVER)
     {
         tsPause.Enabled = false;
     }
     else if (playstate == PlayStates.PLAYING)
     {
         tsPause.Text    = "Pause";
         tsPause.Enabled = true;
     }
     else if (playstate == PlayStates.PAUSED)
     {
         tsPause.Text    = "Continue";
         tsPause.Enabled = true;
     }
     else if (playstate == PlayStates.WIN)
     {
         tsPause.Text    = "Pause";
         tsPause.Enabled = false;
     }
 }