design time serialization (code generation)

  • Thread starter Thread starter WebWacker
  • Start date Start date
W

WebWacker

Hi,

I'm trying to write a Control (inherited from Control) which contains
four panels. These panels are created in the constructor, and are
read-only.

The individual properties of the panels can be set through the
properties window, any changes will be visible in design-time.
However, when I run the application, the properties are lost.

No code is generated which sets the (modified) properties of these
panels.
Could somebody tell me what should be done in order for this to work
correctly?

Thanks in advance,

- WebWacker
 
WebWacker,

All you have to do is expose the panels as public properties on your
control, and they will be visible in the properties window. Any changes you
make to the panels in the property window (through the properties that they
are exposed as) will cause the appropriate code to be placed in the
designer-generated file.

Hope this helps.
 
Hi,

Thanks for your reply, but I already tried exposing the panels as
public properties (read-only).
I can change various settings in design-time, and they are visible
until run-time, but no code is generated.

I've played around a little.
When I set the panel-properties to read/write and set a panel to one I
added to my form, it does generate code for the panel properties. But
this is just a "normal" panel set to my control at a later time.

So it seems that code won't be generated for nested-properties?
I then tried the DesignerSerializationVisibilityAttribute with a value
of Content. This doesn't work either.

I greatly appreciate your help, any suggestions are welcome :)

- WebWacker
 
Back
Top