Public Class FormUpdateService Private aTimer As System.Timers.Timer Private theForm As Form Public Sub SetupForm(ByVal currentForm As form) aTimer = New System.Timers.Timer(10000) AddHandler aTimer.Elapsed, AddressOf OnTimedEvent aTimer.Interval = 1000 aTimer.Enabled = True theForm = currentForm SetButtons(theForm) End Sub Private Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs) SetButtons(theForm) End Sub Public Sub CloseForm() aTimer.Enabled = False aTimer.Dispose() End Sub Private Sub SetButtons(ByVal currentForm As Form) Dim localSystemSignals As SystemSignalsSingleton = SystemSignalsSingleton.GetSingleton Dim fControl As Control For Each fControl In currentForm.Controls If (TypeOf fControl Is CheckBox) Then Dim chBox As CheckBox Dim signals As New List(Of IOItem) Dim returnValue As New IOItem chBox = fControl signals = localSystemSignals.GetIOItems For Each signal As IOItem In signals If signal.ControlName = fControl.Tag Then If signal.ActualSignalValue = 1 Then chBox.Checked = True End If End If Next End If Next fControl End Sub End Class
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE