Click here to Skip to main content
14,659,317 members
Home » Discussions » C#
   

C#

 
QuestionHow do I create a label thats display the time like a digital clock ? Pin
Lim Yuxuan2-Aug-08 17:49
MemberLim Yuxuan2-Aug-08 17:49 
AnswerRe: How do I create a label thats display the time like a digital clock ? Pin
PIEBALDconsult2-Aug-08 18:15
professionalPIEBALDconsult2-Aug-08 18:15 
AnswerRe: How do I create a label thats display the time like a digital clock ? Pin
Paul Conrad2-Aug-08 18:54
professionalPaul Conrad2-Aug-08 18:54 
AnswerRe: How do I create a label thats display the time like a digital clock ? Pin
MarkB7772-Aug-08 19:33
MemberMarkB7772-Aug-08 19:33 
GeneralRe: How do I create a label thats display the time like a digital clock ? Pin
PIEBALDconsult2-Aug-08 20:46
professionalPIEBALDconsult2-Aug-08 20:46 
JokeRe: How do I create a label thats display the time like a digital clock ? Pin
MarkB7772-Aug-08 22:06
MemberMarkB7772-Aug-08 22:06 
GeneralRe: How do I create a label thats display the time like a digital clock ? Pin
PIEBALDconsult3-Aug-08 3:55
professionalPIEBALDconsult3-Aug-08 3:55 
AnswerRe: How do I create a label thats display the time like a digital clock ? Pin
Lim Yuxuan2-Aug-08 21:35
MemberLim Yuxuan2-Aug-08 21:35 
Thanks for your efforts guys.

In the end this is what I did.


private Timer Clock = new Timer();//create a timer

void Clock_Tick(object sender, EventArgs e)
{
//refresh the time every 1 second
this.winFormTimerLabel.Text = DateTime.Now.ToLongTimeString();
}

private void Form1_Load(object sender, EventArgs e)
{
Clock.Interval = 1000;//every 1 second do something
//what the program is supposed to do when 1 second elasped
Clock.Tick += new EventHandler(Clock_Tick);
Clock.Start();//starts the timer
}

I finally understood where did I went wrong - I did not put in the interval value and I did not start the timer..... silly me Laugh | :laugh:
GeneralRe: How do I create a label thats display the time like a digital clock ? Pin
PIEBALDconsult3-Aug-08 5:39
professionalPIEBALDconsult3-Aug-08 5:39 
AnswerRe: How do I create a label thats display the time like a digital clock ? Pin
nelsonpaixao3-Aug-08 14:51
Membernelsonpaixao3-Aug-08 14:51 
QuestionDataset Posistion change Pin
kindman_nb2-Aug-08 9:01
Memberkindman_nb2-Aug-08 9:01 
AnswerRe: Dataset Posistion change Pin
Paul Conrad2-Aug-08 10:28
professionalPaul Conrad2-Aug-08 10:28 
QuestionVS 2005 Server Explorer [modified] Pin
benjamin yap2-Aug-08 7:00
Memberbenjamin yap2-Aug-08 7:00 
AnswerRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 8:15
professionalPaul Conrad2-Aug-08 8:15 
GeneralRe: VS 2005 Server Explorer Pin
benjamin yap2-Aug-08 8:19
Memberbenjamin yap2-Aug-08 8:19 
GeneralRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 8:23
professionalPaul Conrad2-Aug-08 8:23 
GeneralRe: VS 2005 Server Explorer Pin
benjamin yap2-Aug-08 8:25
Memberbenjamin yap2-Aug-08 8:25 
GeneralRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 9:38
professionalPaul Conrad2-Aug-08 9:38 
GeneralRe: VS 2005 Server Explorer Pin
benjamin yap2-Aug-08 19:44
Memberbenjamin yap2-Aug-08 19:44 
GeneralRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 19:48
professionalPaul Conrad2-Aug-08 19:48 
GeneralRe: VS 2005 Server Explorer Pin
benjamin yap2-Aug-08 20:06
Memberbenjamin yap2-Aug-08 20:06 
GeneralRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 20:11
professionalPaul Conrad2-Aug-08 20:11 
GeneralRe: VS 2005 Server Explorer [modified] Pin
benjamin yap2-Aug-08 20:25
Memberbenjamin yap2-Aug-08 20:25 
GeneralRe: VS 2005 Server Explorer Pin
Paul Conrad2-Aug-08 20:50
professionalPaul Conrad2-Aug-08 20:50 
GeneralRe: VS 2005 Server Explorer Pin
benjamin yap3-Aug-08 2:29
Memberbenjamin yap3-Aug-08 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.