I can think of some ugly ways to do it.
One way would be a
mustoverride function GetChildName as string
That way the inheriting class would have to define a function or property if
you prefer to return its name and the base could safely call GetChildName
inside Foo.
You could do the same with an interface if you chose.
I don't know of a quick and easy key word way to do it in VB.NET
"ScottL" <sc**********@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Is there any way to get the name of an inheriting object in the item it
is inheriting from? In my case I am looking for a way to get the name
of a form from its base.
For example
Public Class BaseForm
Public Overridable Sub Foo()
'Can I Get the name of the calling obect in here without
passing it?
End Sub
End Class
Public Class InheritedForm
Inherits BaseForm
Public Overrides Sub Foo()
mybase.Foo()
End Sub
End Class