473,804 Members | 4,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inheriting from ControlCollecti on

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

public AvailabilityCol lection(Control owner)
{ _owner = owner; }

Here is what the .NET SDK has for the ControlCollecti onconstructor:

public ControlCollecti on(
Control owner
);

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

I've also noticed (and this could be related) that theControlColle ction class usually seems to be instantiated byusing a 'CreateControlC ollection' method of a parent class,instead of directly using new ControlCollecti on(object). How canI implement this into a parent class for theAvailability Collection class?
User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #1
1 1676
Try something like

public AvailablilityCo llection(Contro l owner) : base(owner)
{
....
}

"DanielSchaffer " <DanielSchaffer @aew_nospam.com > wrote in message
news:#j******** ******@TK2MSFTN GP15.phx.gbl...
I am trying to create a class that inherits from ControlCollecti on, but I am
getting the compile error "No overload for method 'ControlCollect ion' takes
'0' arguments", and VS highlights the constructor method:

public AvailabilityCol lection(Control owner)
{ _owner = owner; }

Here is what the .NET SDK has for the ControlCollecti on constructor:

public ControlCollecti on(
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 ControlCollecti on
class usually seems to be instantiated by using a 'CreateControlC ollection'
method of a parent class, instead of directly using new
ControlCollecti on(object). How can I implement this into a parent class for
the AvailabilityCol lection class?
User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1566
by: Trevor Germain | last post by:
Scenario: --------- I have an Explorer style application. The app hosts other win forms by making them MDI children, removing border / control box / minimize / maximize, and setting the form's Dock property to Fill. I have recently upgraded my application in the following way: -------------------------------------------------------------
1
5646
by: K | last post by:
Can anyone tell me why VB can successfully inherit from the ControlCollection class but C# can't? When compiling the following 2 classes, the C# version gets a compile error of: "No overload for method 'ControlCollection' takes '0' arguments" // C#
1
1866
by: mccoyn | last post by:
I am having trouble adding a control to ControlCollection in a class I have derived from GroupBox. Here is what I've got __gc class RowColumn : public System::Windows::Forms::GroupBo public RowColumn() ignoredcontrols = new System::Windows::Forms::Control::ControlCollection(this) void IgnoreControl(System::Windows::Forms::Control* control)
0
1764
by: Harry F. Harrison | last post by:
Here's the situation...Context - Using an Inherited WebControl object as a base for server custom controls. In a web custom control, whenever I create a child control and add it to the Controls class, it takes 3 lines of code. Example: Dim TextBox as System.Web.UI.WebControls.TextBox 1..TextBox = New System.Web.UI.WebControls.TextBox
2
1815
by: Charles Law | last post by:
I want a set of controls that all have a border, like a group box. I thought I would create a base control containing just a group box from which my set of controls could inherit. Assuming that this is the right approach (please tell me if it is not), how then do I make it so that the group box cannot be moved around on my set of controls, but is also able to act as container for other controls? If I leave the modifier of the group box...
5
1292
by: Ed Willis | last post by:
What is the best way to make a window read only for an inherited window. How do I access the all the controls such as textboxes etc. to make everything read only? I have an update window that I am inheriting and I am going to make the inherited window read only. Thanks.
3
2352
by: Phill. W | last post by:
Is it possible to extend the Windows.Forms.Form.ControlCollection class and override it's Add method? I'm adding controls to a Form and want to hook up Event Handling for the Form to deal with on behalf of each Control. I /thought/ the best way to do this would be to inherit from and override the Add method on the Form.ControlCollection class and put some AddHandler statements in there. This much I can do but the bit I'm missing is...
3
4058
by: Steve | last post by:
I have a number of controls within a Panel. If I do For Each ctrl In PanelMain.Controls MsgBox(ctrl.Name) Next The controls are not displayed in the sequence I would expect them to be (top left to bottom right). The TabIndex properties are properly set for my expected sequence, but they actually get references in the reverse order. Is there any rhyme or reason behind how For Each works
0
2227
by: Gursharan | last post by:
Hi, I get this error after I did a load test on my website (500 constant user load in team system for 35 minutes). This error is logged after about 1 minute of load testing and is logged every 60 seconds. Any ideas? Event code: 3005 Event message: An unhandled exception has occurred. Event time: 30/07/2006 21:56:12 Event time (UTC): 30/07/2006 20:56:12
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.