Exemplo n.º 1
0
        private void SætEnTimer(object sender, EventArgs e)
        {
            if (listBox2.SelectedIndex > -1)
            {
                // Giv en af timerne fra listbox2 en værdi

                tidTilMineTimer = string.Format("{0:00}:{1:00}:{2:00}", Convert.ToInt32(comboBox1.Text), Convert.ToInt32(comboBox2.Text), Convert.ToInt32(comboBox3.Text));
                listBox2.Items[listBox2.SelectedIndex] = tidTilMineTimer;
                MyTimer timer = new MyTimer(Convert.ToInt32(comboBox1.Text), Convert.ToInt32(comboBox2.Text), Convert.ToInt32(comboBox3.Text));
                myTimers[listBox2.SelectedIndex] = timer;
            }
            else
            {
                MessageBox.Show("Oh well :( ");
            }
        }
Exemplo n.º 2
0
        private void StartTimerKnap(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                textBox1.Text = "0";
            }

            if (textBox2.Text == "")
            {
                textBox2.Text = "0";
            }

            if (textBox3.Text == "")
            {
                textBox3.Text = "0";
            }

            timer = new MyTimer(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox3.Text));

            timer3.Start();
            timer.stopwatch.Start();
        }