|
-
Jan 11th, 2013, 06:28 AM
#1
Thread Starter
Lively Member
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
-
Jan 11th, 2013, 07:11 AM
#2
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
-
Jan 11th, 2013, 08:36 AM
#3
Thread Starter
Lively Member
Re: Timers..
Thanks edge!
-
Jan 11th, 2013, 08:48 AM
#4
Re: Timers..
How many forms timers do you have?
-
Jan 11th, 2013, 11:15 AM
#5
Re: Timers..
This shouldn't be an issue. If you have more than two timers you are doing something wrong.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|