473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Serialize a Form.

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
Nov 17 '05 #1
5 2351
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
"objectref" wrote:
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

Nov 17 '05 #2
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
"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
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
"objectref" wrote:
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

Nov 17 '05 #3
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
"objectref" wrote:
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
"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
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
"objectref" wrote:
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


Nov 17 '05 #4
This may help you
"How to serialize windows Form object to Binary stream"
http://216.26.160.137/Forums/AspNetF...x?PostID=17410

"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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
"objectref" wrote:
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
"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
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
"objectref" wrote:

> 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
>
>
>


Nov 17 '05 #5
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

"Lebesgue" <no****@spam.jp> wrote in message
news:e3*************@TK2MSFTNGP12.phx.gbl...
This may help you
"How to serialize windows Form object to Binary stream"
http://216.26.160.137/Forums/AspNetF...x?PostID=17410

"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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
"objectref" wrote:
> 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
>
>
> "Salvador" <Sa******@discussions.microsoft.com> wrote in message
> news:C2**********************************@microsof t.com...
> > 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
> >
> >
> > "objectref" wrote:
> >
> >> 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
> >>
> >>
> >>
>
>
>


Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: sandy | last post by:
With java servlets I can declare complex object-oriented class structures as session variables in a servlet. That means I can have a complex HTML form that submits iteratively back to the server...
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
10
by: Dan | last post by:
All I Am Attempting To Serialize An Object To An XML File. Here Is The Code For That public string SaveNewSurvey( MutualSurveyObject mso_TempObject, int i_JobID ) { string s_RootFileName;...
3
by: MAY | last post by:
Hi, I have a problem about serialize the form controls. I wrote a test program to test serialize a from but fail (->An unhandled exception of type...
2
by: films | last post by:
I understand the concept. Serialization of a class will add all the sub-objects of the class to the stream if there are also serializible. So say I have: class Author {
3
by: Jeff Richardson | last post by:
This is a repost from the InfoPath news group. Hi, I am writing a SharePoint application that works with InfoPath forms. When a user submits a completed InfoPath form to a forms library my code...
2
by: Joe | last post by:
If I serialize an object from with the same class, any fields with the NonSerializableAttribute still get serialized but not if I serialize from outside the class. Why? This is a simple case to...
3
by: VingeFaan | last post by:
Hello. Can I serialize a UserControl directly? By that I mean the entire control itself, not by using extra inner classes or specific logic for each usercontrol? I have 50ish usercontrols which I...
1
by: donrawe42 | last post by:
Hi, I'm trying to submit a for using remote function and Form.serialize, if I render the contents of the parameter in the controller all I see is . I understand that Form.serialize creates the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.