|
-
Jul 9th, 2009, 07:07 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Can't get radio buttons to save in My.Settings
Hi
I'm trying to save my radio button settings in My.Settings...
At the moment I save the setting in the CheckChanged event for each radio button like this:
Private Sub Option1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Option1.CheckedChanged
If Option1.Checked Then
My.Settings.Option = "1"
End If
End Sub
And then I load the setting in the form_load event, like this:
If My.Settings.Option = "1" Then
Option1.Checked = True
Elseif My.Settings.Option = "2" Then
Option2.Checked = True
..etc
Also in the formclosing event I do My.Settings.Save()
Now this seems to work fine while the program is running. If I do frmSettings.showdialog() and then change the radio button settings and then close the form, and then frmSettings.showdialog() again, the settings will load correctly (so I guess that means they were saved in My.Settings since the form_load event runs each time showdialog is used)
But if I close the program completely and reopen it, the settings will have changed back to the default settings 
Does anyone know what I'm doing wrong?
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|