I have a sample code here:
Dim a As Boolean = False
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If a = True Then
Console.WriteLine("Example of a task that needs to be done during tick event")
End If
End Sub
You can see there that I have a timer tick event, but the event can only be activated if and only if certain conditions are met, which in my case it is a = true
. With that code, I am confident enough that unless I let a = true
, it will disregard the tick event.
Do you think that it is a good idea to depend on the conditions inside the tick event instead of stopping the timer with timer1.stop()
?