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(1 0))
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
"Peter Bromberg [C# MVP]" <pb*******@yaho o.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I believe the keyword you seek is "this".
If you are in a class and type "this." (this and a period)
you should see the methods/ members in that class.
If you wish to refer to a method in a derived class,
use the "base" keyword.
Does that help?
Peter
"FDude" <fd***@hotmail. com> wrote in message
news:eI******** ******@tk2msftn gp13.phx.gbl... In otherwords, how do I force a method in my class to call the method
implementations in the SAME class and not use any potentially overriden
methods in derived classes?