Trying to savesettings on form close but not able to get values from controls.
Posted on 2004-10-12
OK I have a form myForm with a user control on it called myControl. I have a variety of control values on myControl which I load from the registry in the constuctor using getSetting.
WHen myForm is closed, it takes myControl with it. At this point I want to saveSettings for each of the controls on myControl so that the changes the user made are not lost.
I have a sub saveAllSettings which I have tried placing in the finalize and in the dispose methods, but when it comes to saveSetting reading textBox1.text, the textbox.text value is empty, when there was definately some text htere before.
Is there no good time to run save settings? Do I need to make a save button/wire it up to events, or can I do it automatically on form close as I wish? I dont want to make a public method and have myForm call it.