Serialize a Form.

  • Thread starter Thread starter objectref
  • Start date Start date
O

objectref

Hi to all,

let's say i have a form with 2 buttons and 3 textboxes on it.
Is there a way to Serialize the form so when i de-Serialize
and cast it to a Form, i will get back the original form with the textboxes
filled with their original values ??

I have built an app that i want to have the values of many-many forms'
controls
on the disk and then all the values back to the forms,
so i need a way to do this...

Thanks a lot for any help,

objectref
 
Hi,

I think that a form is non-serializable, so I recommend you to build a
struct with the values and serialize the struct, it is also a good practice.

Hope this helps
Salva
 
Hey Salvador,

thanks for the fast reply!

Well, i really have a structure-system designed on the paper but this will
require me
to have different code in each form (the forms are different) to
serialize/de-serialize itself.

I know that Form isn't serializable but i was hoping for a way not known to
me
to do this task a little more automatic!

Bute heym thanks again!

objectref
 
Hi,

If you need to use a multiple form loader you can have a static function
that receives the stream and the form reference and serialize/deserialize the
complete values, of course if the forms are of the same type. Otherwise is
quite tediuous!

:)

Cheers
Salva
 
Yes Lebesgue,

it helped me a lot !

Now, instead of doing a general routine that will save/load form's control
variables,
i will build each form a routine that do just that, especially for each
form!

thanks a lot!

objectref
 
Back
Top