Beispiel #1
0
 private void StopButton_Click(object sender, EventArgs e)
 {
     InputTicks.ReadOnly = false;
     SecondTimer.Stop();
     ShowTicks.Text = string.Empty;
     ShowTicks.Hide();
     Progress.Value = 0;
     Song.Stop();
     MessageBox.Show("Phew... I'm glad you stopped that...\nIt was really starting to tick me off.");
 }
Beispiel #2
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            if (InputTicks.Text != string.Empty)
            {
                try
                {
                    // Get the number of ticks that the user wants and set the input to ""
                    NumberOfTicks   = Int16.Parse(InputTicks.Text);
                    InputTicks.Text = string.Empty;
                }
                catch (Exception s)
                {
                    MessageBox.Show("Exception: " + s.ToString());
                    InputTicks.Text += " <-FixMe";
                }

                if (NumberOfTicks > 0)
                {
                    // Set ShowTicks' text to the number of ticks and show it
                    ShowTicks.Text = NumberOfTicks.ToString();
                    ShowTicks.Show();

                    InputTicks.ReadOnly = true;

                    AlarmGo        = true;
                    Progress.Value = Progress.Maximum = NumberOfTicks;

                    // Start the timer
                    SecondTimer.Start();
                }
                else
                {
                    MessageBox.Show("Input Must be an unsigned number greater than 0!");
                }
            }
            else
            {
                MessageBox.Show("I can't count ticks you haven't given, Sherlock!");
            }
        }