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.
8 1586 PRR 750
Expert 512MB
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.
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.
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
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.
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...
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.
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?
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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...
|
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...
| |