Doru Roman <do*******@rogers.com> wrote:
Then what is the best approach?
I try to use serialization. If the object is saved I want to
unbox the object under a Form_Load event. If the object
is not saved, then I want to create the instance first under
Button1_click event and under a Button2_click I want to save it's state.
To be more descriptive, I try to simulate a playing card deck and I want to
save the cards before I close the application and the next time I open it
I need to use the same configuration of the shufled cards.
Ah, right. Okay, so you need to save the contents to a file, and then
load them in the load event if they're present.
I suggest you split the task in two - first investigate serialization
(look in MSDN and use Google to find serialization tutorials), get the
serialization side of things working with the class you're interested
in, and then hook it up to the actual UI.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too