Sunday, 5 January 2014

C#- Digital Clock

Leave a Comment


This is a example how to create a simple digital clock in C# win form. The example use Timer in C# class and use the Tick event to update the label in the win form.

The Code Behind

  public Form1()
        {
            InitializeComponent();
            Timer T = new Timer();
            T.Tick += new EventHandler(T_Tick);
            T.Start();
        }

        void T_Tick(object sender, EventArgs e)
        {
            DateTime clock = DateTime.Now;
            label1.Text = clock.Hour.ToString("00");
            label2.Text = clock.Minute.ToString("00");
            label3.Text = clock.Second.ToString("00");
        }




By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

0 comments:

Post a Comment

Subscribe to our newsletter to get the latest updates to your inbox.

Your email address is safe with us!




Founder of developersnote.com, love programming and help others people. Work as Software Developer. Graduated from UiTM and continue study in Software Engineering at UTMSpace. Follow him on Twitter , or Facebook or .



Powered by Blogger.