inherits

  • Thread starter Thread starter portroe
  • Start date Start date
P

portroe

Hi all,

I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

any help apprecaited

thanks

Portroe
 
portroe said:
I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is
not defined,

Which namespaces are the classes part of?
 
Some possible causes:
1) Are the 2 classes in the same namespace?
2) Are there any syntax errors in the Person class?
 
Hi,

The definition for Student doesn't come before the End Class of Person does
it?

I've done this before, accidentially defining one class inside another. It
caused
a fair bit of confusion till I spotted it because it auto-syntaxed it, found
in the
object viewer etc...

Regards,
Peter
 
Okay found it,

it was not in the solution explorer,

so I just added new and pasted code again,

I have no idea how I did this,

thanks

Portroe
 
* portroe said:
I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

1. Are the classes in the same project? If not, set a reference.
2. Are the classes in the same namespace and/or are namespaces
imported? If not, then add them to the same namespace or import the
namespace of the base class.
3. If nothing works, type the 'Person' in the definition of the base
class again (that's a bug which sometimes occurs, don't know why).
 
Back
Top