-2

Rookie programmer here! I'll explain what I've done so far:

        private void frmRegister_Load(object sender, EventArgs e)
        {
            lblDateTime.Text = DateTime.Now.ToString();
        }

When the form loads, as I want, the label lblDateTime displays the date and time. However, it only displays the date and time at the point the form loaded.

How do I make it change with the user's computer (live)? Or should I remove this label altogether?

1 Answers1

2

Drop a Timer component on your form and subscribe to the Tick event.
Don't forget to set Enabled to true, or call Start.

Sam Axe
  • 33,313
  • 9
  • 55
  • 89