Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to Run the time as clock on Header Title bar using C#.
Posted

1 solution

Set up a Timer, and set the Form.Text property in the handler:
Form Constructor code:
C#
Timer showTime = new Timer();
showTime.Interval = 500;
showTime.Tick += new EventHandler(showTime_Tick);
showTime.Start();

Handler:
C#
void showTime_Tick(object sender, EventArgs e)
    {
    Text = DateTime.Now.ToString("HH:mm:ss");
    }
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900