private void timer1_Tick(object sender, EventArgs e) { lblClock.Text = DateTime.Now.ToString("hh:mm:ss tt"); }
private void timer1_Tick(object sender, EventArgs e) { // Do something in the background }In this example, the `timer1_Tick` method would perform some task in the background on each tick of the timer. The System.Windows.Forms Timer is part of the .NET Framework, which is a collection of libraries that provide a variety of functionality for developing Windows applications in C# (among other languages).