473,320 Members | 1,695 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,320 software developers and data experts.

Windows Form saving

I want to save windows form and controls (text box,button,user control.. ) along with there properties to hard disk or Database at run time.I tried using with serialization but i am facing some problems like events,form we can't serialize ...Is there any good solution for saving form into disk or Database.

After resorting form also i can able to modify restored form and its controls properties.
Nov 20 '08 #1
8 1586
PRR
750 Expert 512MB
Take a look at this :
From copy
Serialize windows froms
Nov 20 '08 #2
Plater
7,872 Expert 4TB
What do you mean by "save"? I mean the form is already saved in your project, and all the designer-creation stuff is in the built application.

Are you talking about saving the size of the window and other things the user changes? You can either use the registry or the built in "Properties" section of the project to save the settings.
Nov 20 '08 #3
r035198x
13,262 8TB
What do you mean by "save"?...
They probably mean serialize as assumed by DeepBlue. Basically writing the C# objects to a file and retrieving them again without having to destroy and create again from scratch.
Nov 20 '08 #4
Plater
7,872 Expert 4TB
Well I'm not clear how that's usefull unless you're passing the serialized data accross networks (and that seems security hole to me)
Plus, the OP already said serializing was no good because it didn't do the eventhandler wireups
Nov 20 '08 #5
r035198x
13,262 8TB
Well I'm not clear how that's usefull unless you're passing the serialized data accross networks (and that seems security hole to me)
Plus, the OP already said serializing was no good because it didn't do the eventhandler wireups
Perhaps in large and complex GUIs where GUI construction takes lots of time/processing power. I wouldn't be surprised about the other stuff not being correctly serialized. Not every .NET object is serializable out of the box.
Nov 20 '08 #6
balabaster
797 Expert 512MB
It seems to me (without knowing anything about the application) that this type of functionality could be useful if you're trying to allow custom forms to be added dynamically to the application by an application user without needing to recompile. I went part way towards this by allowing custom code to be added to an application by users... I've never done this with full forms, though I imagine a similar (but modified) approach could be taken to do this...

Of course, I don't understand what the OP is trying to achieve, so I can't say for sure that I'd recommend this approach...
Nov 20 '08 #7
r035198x
13,262 8TB
It seems to me (without knowing anything about the application) that this type of functionality could be useful if you're trying to allow custom forms to be added dynamically to the application by an application user without needing to recompile. I went part way towards this by allowing custom code to be added to an application by users... I've never done this with full forms, though I imagine a similar (but modified) approach could be taken to do this...

Of course, I don't understand what the OP is trying to achieve, so I can't say for sure that I'd recommend this approach...
That would be creating widgets, easily achievable by creating reusable classes. Saving state by serialization on the other hand is different. The best example I can give is the hibernate function. You basically save your object's state and then reload those objects again later.
Nov 20 '08 #8
balabaster
797 Expert 512MB
That would be creating widgets, easily achievable by creating reusable classes. Saving state by serialization on the other hand is different. The best example I can give is the hibernate function. You basically save your object's state and then reload those objects again later.
Could that not be done with a statebag? To persist a form's state?
Nov 20 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Garry Freemyer | last post by:
I wrote a screensaver, via Visual Studio 2003 in C# and I decided a wiser choice for me was to use an xml file to save my configs. Btw: I wonder if this is why every bit of documentation I've found...
5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to exit the app, or load a new file, without saving...
4
by: microb0x | last post by:
I have an application with a master form with a tab control containing nine tabs, each tab contains a subform. I have command buttons on my main form including: Save , Cancel , Close. My...
5
by: Ajith Menon | last post by:
I want to copy a part of the windows form into clipboard as .bmp file. The usecase is the user drags using the mouse and creates a rectangular selection any where on the form. This part has to be...
3
by: garyusenet | last post by:
Dear Professionals, I have recently been using the wonderful krypton toolkit and am trying to use them in my small hobby application. I include this bit of info as an aside really because i'm...
13
by: robert.waters | last post by:
Do you have your users rely on the windows taskbar to manage/navigate between the forms they have open, or do you provide another (more robust) method? Does anyone use a custom navigation system...
17
dbanning
by: dbanning | last post by:
I am trying to save the contents of a form as a bitmap and am unsure how to do this. I can use the savepicture command to save the form as a bitmap but the contents is not intact as you would expect....
0
by: castlegrpsf | last post by:
I have a win form using VB.NET that needs to set some values prior to updating a SQL database. The values being stored are computed at the time the user is saving the data. It is based on other...
0
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Hi, I have a windows control containing the web browser control. The user makes some changes to the form in the web browser control, and then the data is saved. I now need to convert this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.