Can't INHERIT another usercontrol.....

J

Jim Hubbard

I have created a simple usercontrol that adds functionality to the
webbrowser control (let's call it ctrl1). I would like to add it to another
usercontrol I am creating (let's call it ctrl2), but I can't INHERIT ctrl1
into ctrl2 because I can only use a single INHERITS statement in a class and
doing so would eliminate the "Inherits System.Windows.Forms.UserControl"
statement needed tom implement ctrl2.

Any suggestions?
 
J

Jim Hubbard

Created a second class within ctrl2 and used the INHERITS statement
there.....but the methods, etc. of ctrl1 don't show up automatically.

Do I have to manually enter all of the methods, etc.?
 
R

Robby

ctrl1 inherits from System.Windows.Forms.UserControl so if ctrl2 inherits
ctrl1 then ctrl2 will also inherit System.Windows.Forms.UserControl.

Robby
 
J

Jim Hubbard

Found an easy way around this.....just declare another class within your
main class and do the second INHERITS call there.....
 
T

Tom Shelton

I have created a simple usercontrol that adds functionality to the
webbrowser control (let's call it ctrl1). I would like to add it to another
usercontrol I am creating (let's call it ctrl2), but I can't INHERIT ctrl1
into ctrl2 because I can only use a single INHERITS statement in a class and
doing so would eliminate the "Inherits System.Windows.Forms.UserControl"
statement needed tom implement ctrl2.

Any suggestions?

Jim...

It's ok to eliminate that Inherits ....UserControl. ctrl1 one, already
inherits from UserControl, so ctrl2 will as well.

Basically, this is ok:

UserControl
|
ctrl1
|
ctrl2

What you can't do is:

UserControl ctrl1
| |
 
J

Jim Hubbard

Thanks Tom.


Tom Shelton said:
Jim...

It's ok to eliminate that Inherits ....UserControl. ctrl1 one, already
inherits from UserControl, so ctrl2 will as well.

Basically, this is ok:

UserControl
|
ctrl1
|
ctrl2

What you can't do is:

UserControl ctrl1
| |
 

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