views:

245

answers:

3

unfortunately my settings do not get saved. please help

If ColorDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
    Form1.BackColor = ColorDialog1.Color
    My.Settings.mytext = My.Settings.mytext & Str(Abs(ColorDialog1.Color.ToArgb)) & ", "

End If

onload i load the settings back into the textbox

+3  A: 

You have to call My.Settings.Save()

Joel Coehoorn
nope does not save, please look at my edit
I__
by this is called anyway when the app is closed
I__
+1  A: 

I did your above code in a windows form and it worked just fine. Are you sure it's not changing? I had a text box set to the value on form load and it did change even though in the app.config it didn't change at all.

EDIT:

Since these are user settings, they are saved in a user.config for the user's profile in local settings\application data folder.

klabranche
very interesting. so how come the app.config did not change at alll?
I__
it's user based saving so it goes in a user.config in the local settings\application data area for your app for the profile of the logged in person.
klabranche
A: 

Each and every time you set a setting, you need to remember to Save that setting otherwise there's really no point in setting it in the first place...

Example:

// edit a setting. My.Setting.MyName = "Jason";

// Now, save it. My.Setting.Save();

:-)

baeltazor