Good afternoon
I've developed some controls that holds specialized collections of items (a
collection of ImageItems for a ImageComboBox, a collection of MenuItems for
a Toolbar, etc.). The controls and the embedded collections interacts each
other correctly and everything work fine.
But I've a problem that I'm not able to solve: when the control
(ImageComboBox, for example) is placed on a form, and it is copied (Ctrl-C)
and then pasted into the same form, the embedded collection is correctly
copied into the new ImageComboBox.
Instead, when it is pasted into another form, the collection of items is
lost.
What I'm missing?
Thank you
Carlo
-------------------------------------------
Carlo, MCP (Windows Based Applications) ca************@ gmail.com 3 1119
Ciao Carlo,
Il Tue, 13 Dec 2005 17:04:29 +0100 hai scritto : Good afternoon
I've developed some controls that holds specialized collections of items (a collection of ImageItems for a ImageComboBox, a collection of MenuItems for a Toolbar, etc.). The controls and the embedded collections interacts each other correctly and everything work fine. But I've a problem that I'm not able to solve: when the control (ImageComboBox, for example) is placed on a form, and it is copied (Ctrl-C) and then pasted into the same form, the embedded collection is correctly copied into the new ImageComboBox.
Instead, when it is pasted into another form, the collection of items is lost.
What I'm missing?
have you implemented a custom designer for your controls? if so be sure to
override the AssociatedCompo nents property in order to return an instance(s)
of the items you need to copy.
Here is simple implememtation:
public override ICollection AssociatedCompo nents
{
get
{
/*
MultiPage is CustomControl holding a "Page" control collection
*/
MultiPage mp = base.Component as MultiPage;
if( mp != null )
{
return mp.Pages;
}
return base.Associated Components;
}
}
Being both italian, translating the answer:
Se hai implemetato un Custom Designer assicurati di fare l'override della
proprietà AssociatedCompo nents ritornando un'istanza dei controlli
contenuti.
Thank you
Carlo
HTH,
Mauro Servienti
whynot [ at ] topics [ dot ] it
--
"...voi abili a tenere sempre un piede qua e uno là avrete un avvenire certo
in questo mondo qua però la dignità dove l'avete persa?..."
"Vasco Rossi - Gli Spari Sopra (1993)"
Hello Mauro
I have implemented a custom designer in all my controls collection, but I
missed an AssociatedCompo nents override.
Now I've implemented it and everithing works as needed! I simply return my
Item collection.
Thank you very much for your help,
sincerey
Carlo
----------------------------
Ciao Mauro
ho implementato un custom designer per ognuno dei controlli che sto
sviluppando, ma non avevo scritto nessun Override di AssociatedCompo nents.
Non è il primo controllo che scrivo che contiene una "custom collection", ma
mi era sfuggito il problema della copia, che ieri ho scoperto quasi
casualmente.
Adesso la copia funziona come deve!
Grazie mille per il tuo prezioso aiuto, e a presto.
Carlo
-------------------------------------------
Carlo, MCP (Windows Based Applications) ca************@ gmail.com
"Mauro Servienti" <ma************ @online.nospam> ha scritto nel messaggio
news:uL******** ********@TK2MSF TNGP12.phx.gbl. .. Ciao Carlo,
Il Tue, 13 Dec 2005 17:04:29 +0100 hai scritto :
Good afternoon
I've developed some controls that holds specialized collections of items (a collection of ImageItems for a ImageComboBox, a collection of MenuItems for a Toolbar, etc.). The controls and the embedded collections interacts each other correctly and everything work fine. But I've a problem that I'm not able to solve: when the control (ImageComboBox, for example) is placed on a form, and it is copied (Ctrl-C) and then pasted into the same form, the embedded collection is correctly copied into the new ImageComboBox.
Instead, when it is pasted into another form, the collection of items is lost.
What I'm missing?
have you implemented a custom designer for your controls? if so be sure to override the AssociatedCompo nents property in order to return an instance(s) of the items you need to copy.
Here is simple implememtation: public override ICollection AssociatedCompo nents { get { /* MultiPage is CustomControl holding a "Page" control collection */ MultiPage mp = base.Component as MultiPage; if( mp != null ) { return mp.Pages; } return base.Associated Components; } }
Being both italian, translating the answer: Se hai implemetato un Custom Designer assicurati di fare l'override della proprietà AssociatedCompo nents ritornando un'istanza dei controlli contenuti.
Thank you
Carlo
HTH, Mauro Servienti whynot [ at ] topics [ dot ] it -- "...voi abili a tenere sempre un piede qua e uno là avrete un avvenire certo in questo mondo qua però la dignità dove l'avete persa?..." "Vasco Rossi - Gli Spari Sopra (1993)"
Ciao Carlo,
Il Wed, 14 Dec 2005 08:59:30 +0100 hai scritto : Hello Mauro I have implemented a custom designer in all my controls collection, but I missed an AssociatedCompo nents override. Now I've implemented it and everithing works as needed! I simply return my Item collection. Thank you very much for your help, sincerey Carlo
You're welcome, see you next time!
Bye,
Mauro Servienti
whynot [ at ] topics [ dot ] it
--
"...voi abili a tenere sempre un piede qua e uno là avrete un avvenire certo
in questo mondo qua però la dignità dove l'avete persa?..."
"Vasco Rossi - Gli Spari Sopra (1993)" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: NutJob |
last post by:
Hello all,
I'm aware that in Python an object is cleared for garbage collection as
soon as the last reference to it disappears. Normally this is fine.
However, in my current project I'm creating a bunch of threads which
are supposed to run until they've completed their run() method, and I'm
worried that if I do not keep references to these thread objects
around, the GC might happily delete them (and thereby kill my thread
routines...
|
by: Dave bailey |
last post by:
When I execute the following code when using a dynamicall
created LinkButton in a dynamically created dataGrid, the
DataGrid disappears and the page I am trying to get to
does not load. Can anyone see what is wrong here?
protected void Grid_ItemCommand (Object sender,
DataGridCommandEventArgs e)
{
if ( e.CommandName == "Details" )
{
|
by: Suzi |
last post by:
I am creating a windows app and I use the data adapter wizard to generate a SQL query. Once the data adapter is created, I generate a dataset from it and my dataset appears in the designer. Then I create another data adapter from the wizard and when that is complete I try to generate the existing dataset from the new data adapter. My dataset disappears from the desinger. If a generate my dataset from data adapter 1 again then a new instance...
|
by: Simon Verona |
last post by:
I have a problem in my application which I believe is due to open handles.. .
The symptom that users report is that after they have been using the application for a while, it will randomly just crash with an exception report (I've not got the details of the error, but I'm working on that now!).
I'm trying to reproduce the circumstances by simulating a typical batch of user tasks on my pc and monitoring whats happening. I'm guessing it's...
|
by: muchan |
last post by:
I'm a C++ programmer now poking into C#.
I wanted to write a snippet of code, equivalent of
//--- C++ code ---------------
#include <string>
#include <vector>
class obj { // a POD class
public:
std::string s;
| |
by: 2D Rick |
last post by:
Using Access2003 and XP:
In a continuous form using only a Form Header and Detail section, the
following occurs:
Three of the many textboxes in the Form Header lose visibility of their
data when the cursor moves to the Detail section. The data still exists
but it disappears.
This does not occur on the first record of this continuous form's
Detail Section, but will occur when focus moves to any other record.
Moving back to row 1 and the...
|
by: Goalie_Ca |
last post by:
I have been reading (or at least googling) about the potential addition
of optional garbage collection to C++0x. There are numerous myths and
whatnot with very little detailed information.
Will this work be library based or language based and will it be based
on that of managed C++? Then of course there are the finer technical
questions raised (especially due to pointer abuse). Is a GC for C++
just a pipe dream or is there a lot of work...
|
by: Born |
last post by:
Here are my challenges to you:
1) Suppose object A has to do cleanup before it dies. Also suppose there are
multiple references to A. How can I determine when and who to call Dispose
(if you use Dispose for the cleanup).
2) Suppose there are some other sources who reference A through handles.
That is, those sources do not reference A directly but through an
intermediate handle mechanism. The purpose is not to interfere with the...
|
by: Deckarep |
last post by:
Hey everyone,
Is there a more elegant or cleaner way of accomplishing the following
null check?
List<stringmyString = null; //Purposely null list of strings to
show the example
XElement element = new XElement("Strings",
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |