Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
How to create a dynamic digital clock ??
i use this kind of logic
lbltime.text = datetime.now.tostring();
 
but it woudn't showing me time with changes in seconds & minutes
 
Thnx in Advance..
Posted 13-Feb-13 5:41am
Edited 13-Feb-13 7:39am
ridoy50.5K
v4
Comments
richcb at 13-Feb-13 11:44am
   
That is not how things work here. You try your project and then if you get stuck, you post the code you have attempted and explain where you are stuck and provide error messages etc, etc. Use the "Improve question" widget to update your thread with the proper info.
joshrduncan2012 at 13-Feb-13 11:49am
   
My 5.
Sergey Alexandrovich Kryukov at 13-Feb-13 11:58am
   
You should start with tagging application type or UI library your use. The question as is makes no sense at all. —SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Sergey Alexandrovich Kryukov at 13-Feb-13 14:36pm
   
Good, but ASP.NET or pure HTML/JavaScipt clock is missing, my 4. :-) More seriously, I suggest not to answer until OP specifies the application time or UI library, platform, all required detail. It's a waste of time to recommend solutions for a number of cases, just in case. —SA
Maciej Los at 13-Feb-13 14:45pm
   
OK, i'll try to remember ;)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you try this in case of windows form then it would be easier than what you think.Pick Timer control on your form.Then right click on it,you will find properties.At the event tag you will find tick event which you need to use.Then code just like as..
        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = DateTime.Now.ToString("hh:mm:ss tt");
        }
And see your clock is ready to operate!One thing need to mention here,you will find interval option in the properties of timer control where you can change interval of your clock.
Happy Coding..Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 448
1 Sergey Alexandrovich Kryukov 425
2 Abhinav S 408
3 sanket saxena 285
4 Tadit Dash 160
0 Sergey Alexandrovich Kryukov 8,482
1 OriginalGriff 4,830
2 Peter Leow 3,794
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid