Application Settings - Stupid Me! I don't get it...

  • Thread starter Thread starter Johnny Jörgensen
  • Start date Start date
J

Johnny Jörgensen

Can somebody explain hopw to store and restore settings values in .NET 2005?
I read in MSDN that "The Application Settings feature of Windows Forms makes
it easy to create, store, and maintain custom application and user
preferences on the client computer."

And then it goes on to explain that you have to create wrapper classes and
bind them to different controls etc...

I don't understand Jack! All I want to do is store the value of a variable
and restore it again, sort of like Visual Basic's GetSetting and SaveSetting
functions. They store settings in the registry, but for my application, I
cannot do that. I have to store them elsewhere.

How the h*** do I do this simple task?

TIA,
Johnny J.
 
Can somebody explain hopw to store and restore settings values in .NET 2005?
I read in MSDN that "The Application Settings feature of Windows Forms makes
it easy to create, store, and maintain custom application and user
preferences on the client computer."

And then it goes on to explain that you have to create wrapper classes and
bind them to different controls etc...

I don't understand Jack! All I want to do is store the value of a variable
and restore it again, sort of like Visual Basic's GetSetting and SaveSetting
functions. They store settings in the registry, but for my application, I
cannot do that. I have to store them elsewhere.

How the h*** do I do this simple task?

TIA,
Johnny J.

Right click the project file and open its properties. Click on the
settings tab and on the pane that opens click create settings file.

Add your settings. In code, you read and write them via
Properties.Settings.Default.

eg. control.BackColor = Properties.Settings.Default.MyBackColor;
Properties.Settings.Default.MyBackColor = Color.Blue;

Properties.Settings.Default.Save to save the settings.

HTH
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top