I am actually reading a book where several examples of classes use the Me
keyword to point to a method inside this class, like Me.Method. The MS
documentation shows the MyClass keyword to do the same thing apparently. Are
there any diferences between these two keywords or any kind of guideline to
when use one or the other?
TIA,
Erik Cruz
Try the following example:
Public Module ErikCruz
Public Sub Main()
Dim x As New DerivedClass()
x.DoIt()
End Sub
End Module
Public Class BaseClass
Public Overridable Sub Method()
Debug.WriteLine("Method()", "BaseClass")
End Sub
Public Sub DoIt()
Me.Method()
MyClass.Method()
End Sub
End Class
Public Class DerivedClass
Inherits BaseClass
Public Overrides Sub Method()
Debug.WriteLine("Method()", "DerivedClass")
End Sub
End Class
Hope this helps
Jay
"Erik Cruz" <erikacf...@antares.com.br> wrote in message
news:#cafq2n5...@TK2MSFTNGP11.phx.gbl...
Me and MyClass do the same, except with overridable members that have been
overriden in a derived class. In that case Me.Method calls the member in the
derived class whereas MyClass.Method calls the method of the class
containing the line.
Armin