469,945 Members | 1,996 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

Can't INHERIT another usercontrol.....

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?
Nov 21 '05 #1
5 1535
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.?
"Jim Hubbard" <re***@groups.please> wrote in message
news:cq********************@giganews.com...
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?

Nov 21 '05 #2

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

Robby
"Jim Hubbard" <re***@groups.please> wrote in message
news:cq********************@giganews.com...
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?

Nov 21 '05 #3
Found an easy way around this.....just declare another class within your
main class and do the second INHERITS call there.....

"Robby" <ed****@not.my.email.com> wrote in message
news:e6****************@tk2msftngp13.phx.gbl...

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

Robby
"Jim Hubbard" <re***@groups.please> wrote in message
news:cq********************@giganews.com...
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?


Nov 21 '05 #4
On 2004-12-11, Jim Hubbard <re***@groups.please> wrote:
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
| |
--------------
|
ctrl2
--
Tom Shelton [MVP]
Nov 21 '05 #5
Thanks Tom.
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:uK****************@tk2msftngp13.phx.gbl...
On 2004-12-11, Jim Hubbard <re***@groups.please> wrote:
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
| |
--------------
|
ctrl2
--
Tom Shelton [MVP]

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jerry | last post: by
6 posts views Thread by Sleepy | last post: by
4 posts views Thread by nick.n.xu | last post: by
1 post views Thread by Michael Evanchik | last post: by
8 posts views Thread by Issac | last post: by
3 posts views Thread by Station Media | last post: by
2 posts views Thread by Joe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.