Previous..
Next..
Here i will explain how to display current date and time by using code in window form.
Step(1):- Form
Drag and down a Leble and a timer from toolbox. when you drag and down a timer it will go down. you can change its property like interval.
Step(2):- Code
Double click on timer and write this code
Private void timer_Tick(object sender, EventArgs e)
{
DateTime datetime = DateTime.Now;
this.time_lbl.Text = datetime.ToString();
}
Private void time_lbl_Click(object sender, EventArgs e)
{
}
And you go at " InitilizeComponent" and write below this
timer1.start();
No comments:
Post a Comment