-
Timers..
How Would You Write This Code:
Code:
Try
Dim cont As Timer
For Each cont In Form1.Controls 'maybe issue..
If (TypeOf cont Is Timer) Then
If cont.Enabled = True Then
DR1.Text += cont.Interval
End If
End If
Next
Catch
MsgBox(ErrorToString)
End Try
What it's supposed to do:
Act As A Shortcut To Let Me Know Of All Active Timers On Form1
Without Having To Write Each Out Individually.
Thanks :)
-
Re: Timers..
Timer is not a control, found a couple examples here, so maybe try,...
Code:
Dim total As Integer
For Each c As Object In Me.components.Components
If TypeOf c Is Timer Then
total += DirectCast(c, Timer).Interval
End If
Next
TextBox1.Text = total.ToString
-
Re: Timers..
-
Re: Timers..
How many forms timers do you have?
-
Re: Timers..
This shouldn't be an issue. If you have more than two timers you are doing something wrong.