The other answer tells you how to fix the problem, but it doesn't explain what's going wrong.
There is a much older Stack Overflow question about the timer options, and it makes a possibly misleading statement about the timer tick waiting. It might be more helpful to discuss the potential implementations of a timer tick:
- A new thread can be spun up to service the tick immediately
- A notification can be posted which is processed at a later time
System.Windows.Forms.Timer
does the latter. In particular, it posts the notification as a Windows message, and when the standard message pump sees the message, it raises a .NET event which is processed on the UI thread.
In most cases, this will mean that processing one tick will prevent anything from happening for the next tick, because the message pump is blocked while the event handler executes.
This only holds as long as the message pump is blocked, though. There are two likely ways it might become unblocked:
- Code to explicitly process messages, like a call to
Application.DoEvents
or equivalent code written directly against the dispatcher
Await
will do this implicitly, as it returns control to the UI will it waits for the asynchronous call to finish. This is by design and is one of the intended use cases for Await
, to allow the UI to be responsive while the asynchronous call is executing.
As in any case where you use Await
, you need to be prepared for re-entrancy and design your code accordingly.