Groups | Blog | Home
all groups > dotnet windows forms designtime > may 2004 >

dotnet windows forms designtime : Designer properties of a control losing/resetting values when placed on a form


Frustrated
5/27/2004 6:03:48 AM
I have developed a number of custom control components and given them a number
of design time properties. Serialisation works most of the time but sometimes
after building, certain properties will magically reset to their default values
.... even though the code in the InitializeComponent call says it is still there
!!!

Seems to be happening on enumerations alot more as the project grows.

It doesn't happen all the time but when it starts to happen it doesn't go away
.... Usually that form the control is being used on will do it for ever.

We all know that the 2003IDE is a little unstable but what the hell is going on
here.

Only a Microsoft guru will be able to shed some light on this one.

All the attributes are being applied ... hey it works mostly but sometimes
things just go weird.
kitchenbin NO[at]SPAM hotmail.com
5/27/2004 10:08:49 PM
Dear Mr.Frustrated
I am having the exact same problem and would also love an answer to
this. To recap, I create or inherit from a control and then add my
own simple enum property. It works fine most the time but for some
instances of the control the IDE will constantly keep reseting the
property. Currently I have to hard-code the values into my code to
keep the enum settings on the property which therefore kinda makes the
visual editor useless.

Please has someone got an answer?


[quoted text, click to view]
Helper
5/28/2004 7:29:52 AM
Just a thought...are your enums declared inside of a class? They have to be
inside a namespace for VS.NET IDE to work with them.

[quoted text, click to view]

Frustrated 2
5/28/2004 5:30:20 PM
Spot On ... but where is that in the docs ? I suppose one can argue that it is
inbetween the lines.

For those who are an object purist, encapsulated enums in a class require you to
do a lot more work I have since found out !

Appreciate the response.

In article <uzlPecKREHA.252@TK2MSFTNGP10.phx.gbl>, Helper says...
[quoted text, click to view]
AddThis Social Bookmark Button