I'm trying to loop all timers and stop all of them but the one I'm running on.
Code
'Block timers
Private Sub blocktimers()
Dim i As Integer
For Each c As Timer In Me.components.Components
If TypeOf c Is Timer Then
If c.Enabled And c.Interval <> 100 Then
carray(i) = c
ReDim Preserve carray(i + 1)
c.Stop()
End If
End If
Next
End Sub
'Release timers
Private Sub releasetimers()
For Each c As Timer In carray
If c IsNot Nothing Then
c.Start()
End If
Next
End Sub
blocktimers() is looping around all timers but releasetimers() only loop around 2 timers and the 2nd timer value is: Nothing
If blocktimers() loops for example 10 timers, releasetimers() is only looping 1.