namespace _2024._03._13___1
{
    public partial class Form1 : Form
    {
        TimeSpan timespan = TimeSpan.Zero;
        System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();
        public Form1()
        {
            InitializeComponent();
            myTimer.Interval = 1;
            myTimer.Tick += Tick;
        }

        private void Tick(object sender, EventArgs e)
        {
            timespan = timespan.Add(TimeSpan.FromSeconds(1));
            timespan = timespan.Add(TimeSpan.FromMilliseconds(1));
            TimeL.Text = $"Time: {timespan.ToString(@"hh\:mm\:ss")}";
            myTimer.Interval = 1000;
        }

        private void StartBtn_Click(object sender, EventArgs e)
        {
            myTimer.Start();
        }

        private void StopBtn_Click(object sender, EventArgs e)
        {
            myTimer.Stop();
        }

        private void KoridoBtn_Click(object sender, EventArgs e)
        {
            StoreL.Text += $"\n{timespan.ToString(@"hh\:mm\:ss\:f")}";
        }
    }
}