Multiple Component Classes

T

TClancey

Hi all.

I'm having some problems with a project I'm working on.

I have a Class Library which contains several Component Classes, each
working independantly. It seems that I can't have two Component Classes
that Inherit the same standard vb control, ie PictureBox.

Do I have to create a whole seperate Class Library for each Component Class?
I've tried creating a new Class Library within the same application but get
the same problems.

Any ideas?

Cheers,
Tull.
 
M

Marina Levit [MVP]

I don't know what makes you think you can't have 2 different classes that
inherit from the same base class - but this is simply not the case.
 
T

Tim Patrick

I'm not quite sure what you mean. If you try to add two classes that each
use a visual designer to the same ".vb" file, Visual Studio will only let
you visually edit the first one. If that is what you are doing, then simply
move one of the classes to its own ".vb" file. If you are already splitting
them into separate files, then please provide additional information.
 
T

TClancey

Sorry, I should have provided more information.

I have created a Class library project.

Within this project I have created several Component Classes.

I had one component class that inherited a picture box, all was well.

I then created another component class and tried to inherit the picture box,
I got an error telling I couldn't use the class as it was already being used
in the base class. I didn't think this was correct.

I've got around the problem by using Control Classes, but this isn't what I
wanted to do.

Any ideas?

Cheers,
Tull.
 
M

Marina Levit [MVP]

Sorry, I don't really follow. If you have 2 different classes, that both
inherit PictureBox, that should compile fine without a problem. I don't know
what it is you are doing or what kind of code you have, I really couldn't
follow what you were saying.
 
T

Theo Verweij

Can you provide us with the clss definitions (class + inherits +
implements statement)?
I get the funny feeling you are trying to implement multiple inheritance
 
T

TClancey

I have since got around the problem and changed all the code, otherwise I
would send it in.

Anyway, thanks for your help.
Cheers,
Tull.
 
T

TClancey

I have since got around the problem and changed all the code, otherwise I
would send it in.

Anyway, thanks for your help.
Cheers,
Tull.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top