Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Data in a Windows Forms App

Status
Not open for further replies.

emmaUK

Programmer
Jan 23, 2006
10
GB
Hello Everybody

I am developing a Windows Forms App which consists of 1 Form.

I would like to be able to save/restore the current state of a few TextBox's a ListBox and some float variables but I don't know how.

I know that I have got to somehow save it to a file using serialization and then restore it by de-serialisation but how do I serialize data and do I:

A: Save the WHOLE Form object?
B: Make a new class to serialize just the object/variables I need?

I have checked out MSDN online and I'm still none the wiser.

Any help is greatly appreciated.

D.
 
Ok guy's I have now managed to Serialize my data and all is fine except when I try to deserialize.

The following line of code throws an exception during runtime and when I removed it from my persistant class it NOW De-Serializes fine so this data member is the problem:

ListBox::ObjectCollection^ listBoxItemsCollection;

So deserializing the ObjectCollection handle is causing the problem. Seems strange that it Serializes this ok.

Any Ideas what I have to do to De-serialize an ObjectCollection?

Emma.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top