473,385 Members | 1,400 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,385 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 1347

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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.