ApplicationSettings not Updated

  • Thread starter Thread starter Yehia A.Salam
  • Start date Start date
Y

Yehia A.Salam

hello,


I'm trying to save simple settingsof my application using the
ApplicationSettings Class:

public Form1(){
InitializeComponent();
Location = Properties.Settings.Default.FormLocation;
Size = Properties.Settings.Default.FormSize;
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e) {

Properties.Settings.Default.FormLocation = Location;
Properties.Settings.Default.FormSize = Size;
Properties.Settings.Default.Save();
}

but for some reason the application always retrieve the initial values and
the Save() method seems not to have any effect.

Thanks
Yehia
 
Only User-scoped application settings can be saved, and this is not
applicable to an ASP.Net application. If you want your app to change some
settings and save the changes, you will have to implement your own settings
solution for that purpose.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

If the Truth hurts, wear it.
 
All my data are User-scoped and this is a c# windows application, and still
Save() has no effect


<DIV>&quot;Kevin Spencer&quot; &lt;[email protected]&gt; wrote in message
 
Ah, sorry I mistook the question for an ASP.Net one!

How are you creating your Settings? Are you using Visual Studio.Net's IDE?

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. never mind.
 
I moved the lines from the form construct to the form load and it worked (I
have not idea how this solved the problem)

<DIV>&quot;Kevin Spencer&quot; &lt;[email protected]&gt; wrote in message
 
Back
Top