Michael

Michael

  • NA
  • 40
  • 0

XML Setting don't save

Jun 5 2008 8:01 AM
okay this is driving me nut and it is probably such a simple solution but for the life of me i can't figure out what i'm doing wrong

okay i have the following code
Properties.Settings.Default.ShowAdvanced = this.tsbAdvancedMode.Checked;
Properties.Settings.Default.Save();


now i ththought that this was the way to save a setting to the config file, but it didn't.

to test it i did this

MessageBox.Show(Properties.Settings.Default.ShowAdvanced.ToString());
Properties.Settings.Default.ShowAdvanced = this.tsbAdvancedMode.Checked;
MessageBox.Show(Properties.Settings.Default.ShowAdvanced.ToString());
Properties.Settings.Default.Save();
Properties.Settings.Default.Reload();
MessageBox.Show(Properties.Settings.Default.ShowAdvanced.ToString());

the output was 3 message boxes
true
false
false

which is the expected output
so i close the app down open the config and it's still true


so what have i missed
ShowAdvanced is scoped as user

Answers (5)