PDA

View Full Version : Inheritance in VB


Ed James
08-06-2001, 03:49 AM
I'm trying to find a code example of class inheritance in VB.

Something quite simple like the often quoted example in C++ of a base "Shape" class, various derived classes "Square", "Circle" etc and a base class "Area" method which is different for each "Shape" class.

I'm not even sure if inheritance works in a similar way to C++ so any help very welcome.

Yoda
08-06-2001, 04:09 AM
To my knowledge there is no such thing as class inheritance in VB. You can try using interface inheritance, look for COM sources for examples of how to do this.

<font color=green>Do or do not
There is no try</font color=green>

Thinker
08-06-2001, 10:11 AM
Yoda is correct. Interface inheritance is the only way and it is like Java Interfaces. You have create every method of the supported interface. VB.NET is supposed to support true inheritance.

I think therefore I am... sometimes right. images/icons/wink.gif