Saving objects to a collection for later retrieval

  • Thread starter Thread starter eljainc
  • Start date Start date
E

eljainc

Hi I'm looking for general code examples to save a form or the
components of a form for later retrieval.

For example, lets say at runtime some controls (listview, panel,
labels) were placed onto a form.
Is there a way to save these items, their general properties (position
on the form or parent control) and to reload them later?

I'm gathering it would be a collection or container that of some sort.

Thanks.
Mike McWhinney
 
Mike,

Unfortunately, for windows controls, there is no easy way to do this.
Normally, you would use serialization for this, but the controls do not
support serialization.

You could ^try^ and use the XmlSerializer class to serialize the
instances, since it works by only serializing the public write properties of
a class. It might give you what you want.

Hope this helps.
 

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

Back
Top