Udostępnij za pośrednictwem


Class '<classname>' cannot inherit from itself: <message>

An Inherits Statement in a class definition specifies its own class.

A class can inherit from another class, which provides it with all the members of the class it inherits from, so it does not have to define those members again. Such a class is called a derived class, and the class it inherits from is called the base class.

It is meaningless for a class to inherit from itself, because it already possesses all its own members.

Error ID: BC30257

To correct this error

  1. Check the spelling of the class name in the Inherits statement.

  2. If you do not intend to inherit from a different class, remove the Inherits statement entirely.

  3. Examine the cited message for suggestions.

See Also

Other Resources

Inheritance in Visual Basic

Understanding Classes