Inheriting from TabPageCollection and TabPage visibility?

T

TCook

Hello All,

First I tried to inherit from the TabPageCollection class but received the
following error message:

No overload for method 'TabPageCollection' takes '0' arguments

I also tried implementing a custom collection and the tabpages show up
during design time in the properties but the tabs are never visible during
design or runtime. The collection contains classes inherited from a tabpage
control.

In short, I just want the tabs to show up during design and runtime and I
need the custom properties to be available during runtime.

Any ideas?

Thanks & Regards,

TC
 
M

Mark Carew

Hi TCook,

Just a wild guess from my getting to know c# as I havn't ventured to any
serious codeing yet.

This error occurs because you have not explicilty added a call to the base
class'es constructor in your derived class'es constructor.When you don't add
this call the compiler adds a parameterless base constructor call. I
havn't checked but would assume that the constructor for TabPageCollection
is passed some arguments.

If this is the case, you would have to add the following to your derived
class'es constructor. " :base(x,y,z...) " where x,y,z.. match the arguments
for the base class'es constructor, in this case TabPageCollection

If your base class had, as one of its constructors, a constructor that took
no arguments, you would have got away with not adding the :base(x,y,z...) to
your derived constructor. Must be that TabPageCollection does not have a
parameterless constructor amongst its constructors.

Hence the error message
No overload for method 'TabPageCollection' takes '0' arguments
could perhaps be more clearly stated as
'TabPageCollection' does not have a '0' argument constructor method
to overload from your derived class
First I tried to inherit from the TabPageCollection class but received the
following error message:

No overload for method 'TabPageCollection' takes '0' arguments

Can't help with the rest of your problem at the moment

Mark Carew
Brisbane Australia
 
M

Mark Carew

Hi TCook,

Just a wild guess from my getting to know c# as I havn't ventured to any
serious codeing yet.

This error occurs because you have not explicilty added a call to the base
class'es constructor in your derived class'es constructor.When you don't add
this call the compiler adds a parameterless base constructor call. I
havn't checked but would assume that the constructor for TabPageCollection
is passed some arguments.

If this is the case, you would have to add the following to your derived
class'es constructor. " :base(x,y,z...) " where x,y,z.. match the arguments
for the base class'es constructor, in this case TabPageCollection

If your base class had, as one of its constructors, a constructor that took
no arguments, you would have got away with not adding the :base(x,y,z...) to
your derived constructor. Must be that TabPageCollection does not have a
parameterless constructor amongst its constructors.

Hence the error message
No overload for method 'TabPageCollection' takes '0' arguments
could perhaps be more clearly stated as
'TabPageCollection' does not have a '0' argument constructor method
to overload from your derived class
First I tried to inherit from the TabPageCollection class but received the
following error message:

No overload for method 'TabPageCollection' takes '0' arguments

Can't help with the rest of your problem at the moment

Mark Carew
Brisbane Australia
 

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