473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Complex question about using collections from derived Controls in V. Studio Designer

Hi,

I'm writng a control derived from UserControl (let's call this control
MyControl) that itself is meant to be derived further times.

MyControl hosts a public collection of specialized non-GUI objects.
This collection is therefore accesible from any controls derived from
MyControl. Derived controls have to be able to add, change and remove
objects from the collection.

In MyControl I set the DesignerVisibility to Content so that the
code-generation engine properly generates the code for the collection
and when I initialize MyControl, I add some objects to the collection.

Now, here's where the problem starts. The code generation for controls
derived from MyControl will generate code to create and add all
objects in the collection, even if some of these were added in
MyControl and there's already code (in MyControl) to create and add
them.

The situation is similar to that of the ControlCollection in Controls,
but here somehow, the code-generator doesn't add controls present in
the super-calss again.

I could not find any references or documentation of how to deal with
this, so I'm asking for some help. Has anybody had some experience
with this?

Sebastian

PS: I'll post some code if anybody needs an alternative explanation.
Thanks
Jul 21 '05 #1
0 1348

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

Similar topics

0
by: Sebastian Ferreyra | last post by:
Hi, I'm writng a control derived from UserControl (let's call this control MyControl) that itself is meant to be derived further times. MyControl hosts a public collection of specialized...
3
by: scoobydoo | last post by:
Hello, I am trying to implement ICloneable's Clone() function, using Serialization. However, my code causes an exception. I have a class derived from TreeNode called "Node1". In Node1, I...
0
by: Henry | last post by:
Using ideas provided by some of you I was able to figure out how to get the names of the parameters fields of a crystal report specified at run time. The code below just basically puts the...
5
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access...
12
by: Oleg Subachev | last post by:
I am moving from Delphi to C# and hve encountered the problem: I have the following classes and form Load event handler: public class class1 { public string S; public class1( string aS ) {...
0
by: Edward Diener | last post by:
I have a base class derived from System.Web.UI.Page, and derived classes derived from the base class. The base class has protected HTML hidden fields in it, and the derived class's aspx page has...
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
1
tlhintoq
by: tlhintoq | last post by:
So I've created my own class SmartForm, derived from Form... public partial class SmartForm : Form It contains methods for things like remembering position, fading in or out, logging and so on. ...
1
by: =?Utf-8?B?Q2hyaXN0aWFuIFdlaW5lcnQ=?= | last post by:
Hello, I currently fight with a problem during the derivative of WinForm controls. In Visual Studio I created a new User Control. This control is derived from the DataGridView of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.