1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
System.Windows.Forms.Timer
A Windows Forms component that raises Tick events at approximately regular intervals while the application's UI message loop is running. Domain: C# → .NET → System.Windows.Forms → Periodic UI Events
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
Creates a new Windows Forms Timer.
timer.Interval = 1000;
Sets the approximate interval between Tick events to 1000 milliseconds, or one second.
int interval = timer.Interval;
Gets the Timer's configured interval in milliseconds.
timer.Start();
Starts the Timer so it can begin raising Tick events at the configured interval.
timer.Stop();
Stops the Timer from raising additional periodic Tick events until it is started again.
timer.Enabled = true;
Enables the Timer, allowing it to raise Tick events.
timer.Enabled = false;
Disables the Timer so it stops raising Tick events.
bool running = timer.Enabled;
Gets whether the Timer is currently enabled.
timer.Tick += Timer_Tick;
Registers an event handler that runs whenever the Timer raises its Tick event.
timer.Tick -= Timer_Tick;
Unregisters the specified event handler from the Timer's Tick event.
timer.Dispose();
Releases resources used by the Timer when it is no longer needed.
timer.Interval = 500; timer.Start();
Configures the Timer to raise Tick events approximately every half-second and starts it.
timer.Stop(); timer.Interval = 2000; timer.Start();
Stops the Timer, changes its interval to approximately two seconds, and starts it again.