Can't INHERIT another usercontrol.....

  • Thread starter Thread starter Jim Hubbard
  • Start date Start date
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?
 
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.?
 
ctrl1 inherits from System.Windows.Forms.UserControl so if ctrl2 inherits
ctrl1 then ctrl2 will also inherit System.Windows.Forms.UserControl.

Robby
 
Found an easy way around this.....just declare another class within your
main class and do the second INHERITS call there.....
 
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
| |
 
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
| |
 
Back
Top