TRAININGBSC
asked on
Saving form settings in external in VB.net
I have a form in my application that has some input controls like text boxes and radio buttons. I would like to be able to save the status of that window in an external file and be able to load it after wards. I know how to work with the My.Settings namespace and I tried a couple of things but it requires a lot of code to specify if you want the app to save the settings upon closure or not.
I heard about working with XML files and .INI files but I would like to have a little idea of how would that work in the code.
Any ideas?
Thanks in advance!
I heard about working with XML files and .INI files but I would like to have a little idea of how would that work in the code.
Any ideas?
Thanks in advance!
http://msdn.microsoft.com/en-us/magazine/cc163812.aspx
You can loop througth children Controls of your Form, and than througth children controls of this contols(recursion).., than using Reflection you an access all propereties of Contols. Save their name and type to xml, names and values of all properties. To Resotre them you should loop backwards.
Or you can try Serialize Form(if it is serializable).
Or you can try Serialize Form(if it is serializable).
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.