How to finish the pendign input remaining last time?
-
Hi,everyone! I have some difficuties in my project. There are a lot of controls such as textbox and combobox in project, my question is: if I just input some values (not all) into these controls and then close the application; when I open the application next time, I want these controls could shown with values that I inputed last time. What should I do to achieve it?Please give me some suggestions, thank you!
-
Hi,everyone! I have some difficuties in my project. There are a lot of controls such as textbox and combobox in project, my question is: if I just input some values (not all) into these controls and then close the application; when I open the application next time, I want these controls could shown with values that I inputed last time. What should I do to achieve it?Please give me some suggestions, thank you!
You'd have to save the available data somewhere before the app closes (a FormClosing event could help); and restore it when your app runs again (e.g. in a Form.Load event). Somewhere could be one or more files, or a database. I suggest you read a couple of articles here on CodeProject, at best you might come up with some functional search terms that match or come close to your application domain. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
You'd have to save the available data somewhere before the app closes (a FormClosing event could help); and restore it when your app runs again (e.g. in a Form.Load event). Somewhere could be one or more files, or a database. I suggest you read a couple of articles here on CodeProject, at best you might come up with some functional search terms that match or come close to your application domain. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Hi,Luc! Thank you very much! I will search some articles to read :) By the way,could you give me some keywords for search ;P Thanks!
CodeProject search articles for
save restore form state
gave as first hit: Save and restore the state of a Windows Form in .NET 2.0[^] which uses registry (IMO not recommended except for a single very simple form). :)Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.