1

I have an application with about 15.000 lines of code. It's showing some data to the user. To keep the data updated it is running a Windows.Forms.Timer . The shown data updates on each tick.

To avoid unnecessary network traffic and computer utilization on the SQL Server the timer is stopped as soon as the user goes into sub-forms using .Enabled = False or .Stop(). When they close the subform the timer is restarted with .Start() or .Enabled = True.

Somewhere in the code is a problem, that causes the Timer to completly stop so data will not be refreshed anymore. I need to find out where that happens.

To do that I am creating a new class, that Inherits Windows.Forms.Timer. I want to overload the Enabled property, Start() and Stop() sub.

Turns out that I can't.

Trying to overload the Stop() sub gets me into an Error shown by Visual Studio telling me, that I am not allowed to use 'Stop()' as a Sub-Name due to it beeing a keyword. It's not just a warning but an error that keeps me from compiling.

Can I turn this error off for these specific lines or can you give me a different approach to solve the main problem?

Public Class MyApp_RefreshTimer
    Inherits Windows.Forms.Timer

    Private Overloads Property Enabled As Boolean
        Get
            ' A part of my logging will be placed here.. probably
            Return MyBase.Enabled
        End Get
        Set(value As Boolean)
            MyBase.Enabled = value
        End Set
    End Property

    Public Overloads Sub Stop()

    End Sub

End Class
Luke
  • 751
  • 2
  • 7
  • 32

1 Answers1

1

Since "Stop" is a keyword, you would have to bracket the procedure name:

Public Overloads Sub [Stop]()

End Sub
LarsTech
  • 80,625
  • 14
  • 153
  • 225