Inheriting from ControlCollection

D

DanielSchaffer

I am trying to create a class that inherits fromControlCollection, but I am getting the compile error "Nooverload for method 'ControlCollection' takes '0' arguments",and VS highlights the constructor method:

public AvailabilityCollection(Control owner)
{ _owner = owner; }

Here is what the .NET SDK has for the ControlCollectionconstructor:

public ControlCollection(
Control owner
);

So, I'm not sure what exactly I'm doing wrong here.

I've also noticed (and this could be related) that theControlCollection class usually seems to be instantiated byusing a 'CreateControlCollection' method of a parent class,instead of directly using new ControlCollection(object). How canI implement this into a parent class for theAvailabilityCollection class?
User submitted from AEWNET (http://www.aewnet.com/)
 
P

Peter Rilling

Try something like

public AvailablilityCollection(Control owner) : base(owner)
{
....
}

I am trying to create a class that inherits from ControlCollection, but I am
getting the compile error "No overload for method 'ControlCollection' takes
'0' arguments", and VS highlights the constructor method:

public AvailabilityCollection(Control owner)
{ _owner = owner; }

Here is what the .NET SDK has for the ControlCollection constructor:

public ControlCollection(
Control owner
);

So, I'm not sure what exactly I'm doing wrong here.

I've also noticed (and this could be related) that the ControlCollection
class usually seems to be instantiated by using a 'CreateControlCollection'
method of a parent class, instead of directly using new
ControlCollection(object). How can I implement this into a parent class for
the AvailabilityCollection class?
User submitted from AEWNET (http://www.aewnet.com/)
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top