コード例 #1
0
 private void RollTimer_Tick(object sender, EventArgs e)
 {
     counter--;
     if (counter == 0)
     {
         RollTimer.Stop();
         SystemSounds.Exclamation.Play();
         MessageBox.Show("Roll", "Roll");
     }
     TimeLeftLabel.Text = counter.ToString() + " seconds";
 }
コード例 #2
0
        private void materialFlatButton1_Click(object sender, EventArgs e)
        {
            var TimeInMinutesText = materialSingleLineTextField1.Text;

            if (TimeInMinutesText == null)
            {
                MessageBox.Show("You did not input a valid number.");
                return;
            }
            counter            = Convert.ToInt32(TimeSpan.FromMinutes(Convert.ToDouble(materialSingleLineTextField1.Text)).TotalSeconds);
            RollTimer.Interval = 1000;
            RollTimer.Start();
            TimeLeftLabel.Text = counter.ToString();
        }
コード例 #3
0
 private void materialFlatButton2_Click(object sender, EventArgs e)
 {
     RollTimer.Stop();
     TimeLeftLabel.Text = "NONE";
 }