How to persist dynamic controls

  • Thread starter Thread starter Kurt
  • Start date Start date
K

Kurt

I'm working on an app where the user starts with a blank
form and dynamically builds controls via menu selections.

For Example:

Add Object A... set various properties
Add Object B as Child of A... set various properties
Add Object C as Child of A... set various properties
Add Object B1 as child of B... set various properties
Add Object B2 as Child of B... set various properties
Add Object C1 as child of C... set various properties
Add Object C2 as Child of C... set various properties

I can accomplish the above just fine, but now I want to
Save and rebuild this structure the next time the user
runs the app.

A simple sample doing this for a couple of controls
should get me on my way...

TIA

Kurt
 
Hi Kurt,
I don't have direct a sample that fits your problem, but this looks typical
XML
I would take a look at that, there are so many samples to fix your problem
with that.
But you have to take one that fits you the best.
Cor
 
Hi Kurt,

I'm sorry that I have no sample, but the method is to use recursion on the
Controls properties of your Form and the Controls therein, and use
Serialization for each Control found.

I hope that gets you started.

Regards,
Fergus
 
Back
Top