コード例 #1
0
 private void PauseShotClock()
 {
     ShotClockTimer.Stop();
     Pause = 1;
     Startbutton2.Enabled = true;
     Pausebutton2.Enabled = false;
 }
コード例 #2
0
        private void ShotClockTimer_Tick(object sender, EventArgs e)
        {
            if (flag1 == 0 && Pause == 0)
            {
                if (ShotCheck == 0)
                {
                    Second2 = Value1;
                    flag1   = 1;
                }
                if (ShotCheck == 1)
                {
                    Second2 = Value2;
                    flag1   = 1;
                }
                Pause = 1;
            }
            if (Second2 != 0)
            {
                Second2--;
                ShotClocktextBox.Text = Second2.ToString();
                if (Second2 <= 5)
                {
                    ShotClocktextBox.BackColor = ShotClocktextBox.BackColor;
                    ShotClocktextBox.ForeColor = Color.Red;
                    Player3.Play();
                }

                if (Second2 == 0)
                {
                    Player4.Play();
                    ShotClocktextBox.Text = "00";
                }
            }
            else
            {
                ShotClocktextBox.BackColor = ShotClocktextBox.BackColor;
                ShotClocktextBox.ForeColor = Color.Black;
                ShotClockTimer.Stop();
            }
        }