I have an app that runs as a Windows Service and in my OnStart event, I create a server base timer. I have it working right and the ElapsedEventHandler works fine, too.
My question is.... Once I create the timer in my onStart event, how do I change the Interval or test to see if the timer is enabled in other code? Just the basic get/set properties & methods. I just don't know how to reference the timer object that I created on the fly. (oSettings is my class for my global app vars)Code:'Create new Server based Timer Dim oSettings As New Settings() oSettings = New Settings() Dim myTimer As New System.Timers.Timer() AddHandler myTimer.Elapsed, _ New System.Timers.ElapsedEventHandler(AddressOf Me.myTimer_Elapsed) myTimer.Enabled = True myTimer.Interval = oSettings.Interval
thanks,




Reply With Quote