I assume the "Object does not match target type" is the Message property of a TargetException exception...
This can occur during reflection when the framework is asked to invoke a method or constructor on an object where it thinks the object it is given is not an instance of the type in question. I can't offer any detail why the designer would cause this. Could you provide more detail of the exception? Does this occur as you add an item, during runtime, or do you get the lovely designer screen with the error at the top instead of the form? On Tue, 19 Dec 2006 02:33:27 -0500, Uriel Cohen <[EMAIL PROTECTED]> wrote: >I have an owner control that I wrote for .NET 1.1 and VS 2003 which >interacted with the designer. It actually allowed me to edit a collection >of ColorEntry instances. A ColorEntry instance is a (Color, string) pair, >i.e., a definition of a color and a name for it. >I actually created my own TypeConverter to transform it to text, something >like (Red; 255, 0, 0) , and my own Collection class to handle the >collection. >My control had a property which returned the collection with the attributes: > >[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] >[Editor(typeof(ColorEntryCollectionEditor), typeof >(System.Drawing.Design.UITypeEditor))] > >So... everything worked fine in VS 2003. I had a collection editor that >allowed me to add new ColorEntry instances and to edit their Color and Name >properties. > >I used this control in a VS 2005 project (in .NET 2.0), and the problem >that I am having is that when I add a new instance of ColorEntry with the >ColorEntry Collection Editor (in the designer), I get the text >"Object does not match target type." >for both properties of ColorEntry (Color and Name), and I cannot edit >neither of them. > >Does anyone know of any functional changes (or API changes) in any of the >following classes that can explain the difference in behavior: >System.Drawing.Design.UITypeEditor >ExpandableObjectConverter >CollectionEditor ? =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com