You can go to the top of the property grid and setup the properies to be
loaded from the config file. this is probably the best bet as it will not
involves hacking the designer file which is repeatedly re-written.

Signature
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
> Hi -
>
[quoted text clipped - 28 lines]
>
> }
Hello Oli,
>I would like to set some properties to constants (these may ultimately
>come from app.config) eg the Size property.
You should be able to bind such properties directly to external settings.
To do this, select your form, then select the entry
ApplicationSetting/PropertyBindings from the properties window. There'll
be a button with an ellipsis on it there for the setting. Click that. Then
find the property you want to bind and create a new setting for it. VS
will automatically make all the necessary changes to add an entry to
app.config for you and bind the property to it.
Now, for the Size property this is apparently impossible... I remember
having seen that before, but I'm not aware of the reason. It's pretty easy
to work around by using the ClientSize property instead.
>If I do this in my Form constructor - then the values seem not to get
>applied in the designer.
The constructor of the form you're designing is not executed by the VS
designer, only the code in the InitializeComponent method. What's
confusing in the beginning is that the constructors of base classes of
that form *are* actually executed - makes sense when you think about it.
>Also - the "InitializeComponent" call has
>already done a Suspend/Resume layout - so I am concerned that changing
>properties subsequently might cause flicker etc.
Well, there's nothing keeping you from using SuspendLayout/ResumeLayout
yourself. That would certainly be the clean way of doing this.
>I have taken to changing the .designer.cs file by hand - but this is
>surely nasty....
Yes, that's nasty... I'm wondering: as this is clearly a runtime
customization feature you're trying to implement, why is it so important
to you to have the mechanism working at design time? Wouldn't it suffice
to have some default value at design time and the custom settings at
runtime? This is definitely the hard part of the problem and I'm not sure
there's a graceful solution to it.
Oliver Sturm

Signature
http://www.sturmnet.org/blog