Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Collection Editor
 

Collection Editor

Hi
Is it possible to handle the addition and removal of 
elements to a CollectionEditor at DesignTime.
Wot i mean is that when i inherit a class from 
CollectionBase, i automatically get a CollectionEditor at 
DesignTime. I have also implemented the Add, Remove, and 
an Indexer, etc. methods in my CollectionClass to accept 
my Components. 
However, these methods do not get called at DesignTime.
Its only at runtime, that these methods are called. i want 
that at designtime i be able to access these methods, so 
that i can do custom processing before the addition or 
removal of components at DesignTime.

Thanks
Vikas
MigrationUser 1  Wednesday, June 25, 2003 5:38 AM
I have a feeling that you will need to create your own CollectionEditor derived from the existing.  Then, you would override CreateInstance and DestroyInstance or GetItems and SetItems.  I don't know for sure if it will work, but that's how I would approach it...
MigrationUser 1  Wednesday, June 25, 2003 6:30 PM
Make sure that your Add, Remove and Indexer are Overloading the underlying Methods in CollectionBase.  If you do that, then they will be the only ones available to the CollectionEditor and should be the ones that get called.
MigrationUser 1  Monday, June 30, 2003 3:39 AM

You can use google to search for other answers

Custom Search

More Threads

• Treeview - using images only on children
• UserControl problem...
• Form Designer and negative coordinates
• C# Designer don't load
• groupbox heading text font changeable or not?
• VS2005's Form Designer can't find the event's handler if defined in parents class. (VS2003 works)
• Custom ToolBoxItem
• The UserControl preview does not gets updated on deleting items in CollectionEditor.
• How can I change the text of all controls in a form from chinese to english
• Set the DataGrid View column width dynamically