CapDemo.Open_Game.timer1_Tick C# (CSharp) Метод

timer1_Tick() приватный Метод

private timer1_Tick ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (countTime >=2)
                {

                    if (int.Parse(lbl_Time.Text) != 0)
                    {
                        lbl_Time.Text = (int.Parse(lbl_Time.Text) - 1).ToString();
                    }

                    if (int.Parse(lbl_Time.Text) <= 5 && int.Parse(lbl_Time.Text) >= 1)
                    {
                        try
                        {
                            axWindowsMediaPlayer1.URL = (Directory.GetCurrentDirectory()) + "\\Sound\\DongHo.wav";
                            axWindowsMediaPlayer1.Ctlcontrols.play();
                        }
                        catch (Exception)
                        {
                        }

                    }
                    if (int.Parse(lbl_Time.Text) == 0)
                    {
                        timer1.Stop();
                        try
                        {
                            axWindowsMediaPlayer1.URL = (Directory.GetCurrentDirectory()) + "\\Sound\\HetGio.wav";
                            axWindowsMediaPlayer1.Ctlcontrols.play();
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
                countTime++;
        }