Hey Peter,
The VB equivalent to "this" is "Me". It works exactly the same way.
On the other hand, MyClass says to always call this classes implementation
of a method or property even if it is overriden by a derived class.
Class Foo
Public Overridable Function Bar(ByVal x as Integer) As Integer
Return x + x
End Function
Public Sub Test()
MsgBox(Me.Bar(10))
MsgBox(MyClass.Bar(10))
End Sub
End Class
Class Foo2 : Inherits Foo
Public Overrides Function Bar(ByVal x as Integer) As Integer
Return x * x
End Function
End Class
Sub Main()
Dim f2 as New Foo2()
f2.Test()
' First MsgBox shows 100 - Foo2's implementation of Bar
' Second MsgBox shows 20 - Foo's implementation of Bar
End Sub
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada