using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp5 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } int s = 0, m = 0, h = 0; private void button2_Click(object sender, EventArgs e) { timer1.Stop(); } private void button3_Click(object sender, EventArgs e) { timer1.Stop(); s = 0; m = 0; h = 0; label4.Text = h.ToString(); label5.Text = m.ToString(); label6.Text = s.ToString(); } private void button4_Click(object sender, EventArgs e) { var form2 = new Form2(); form2.Show(); } private void button1_Click(object sender, EventArgs e) { timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { s++; if (s == 59) { m++; s = 0; } if (m == 59) { h++; s = 0; } if (h == 60) { h = 0; m = 0; s = 0; } label6.Text = s.ToString(); label5.Text = m.ToString(); label4.Text = h.ToString(); } } }