How to persist dynamic controls

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
 
C

Cor

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
 
F

Fergus Cooney

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top