settings.settings property is read-only?
-
I'm trying to save one of my settings.settings fields when I close my VS 2012 C# app but I'm getting an error saying this is a read-only property. Where so I change it to read/write? Thanks...
private void FormMain\_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.emailAddress = "someone@isp.com"; }
-
I'm trying to save one of my settings.settings fields when I close my VS 2012 C# app but I'm getting an error saying this is a read-only property. Where so I change it to read/write? Thanks...
private void FormMain\_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.emailAddress = "someone@isp.com"; }
If your setting is a User Setting, you need to save all the current User Settings to make them persist between Application use; if your Setting is an Application Level Setting, you cannot change it at run-time. In the Visual Studio Settings Designer you can change the scope of a Setting to 'User.
Properties.Settings.Default.Save();
Quote:
Settings that are application-scoped are read-only, and can only be changed at design time or by altering the .config file in between application sessions. Settings that are user-scoped, however, can be written at run time just as you would change any property value. The new value persists for the duration of the application session. You can persist the changes to the settings between application sessions by calling the Save method. [^]
I found the information here useful: [^].
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
-
If your setting is a User Setting, you need to save all the current User Settings to make them persist between Application use; if your Setting is an Application Level Setting, you cannot change it at run-time. In the Visual Studio Settings Designer you can change the scope of a Setting to 'User.
Properties.Settings.Default.Save();
Quote:
Settings that are application-scoped are read-only, and can only be changed at design time or by altering the .config file in between application sessions. Settings that are user-scoped, however, can be written at run time just as you would change any property value. The new value persists for the duration of the application session. You can persist the changes to the settings between application sessions by calling the Save method. [^]
I found the information here useful: [^].
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
-
If your setting is a User Setting, you need to save all the current User Settings to make them persist between Application use; if your Setting is an Application Level Setting, you cannot change it at run-time. In the Visual Studio Settings Designer you can change the scope of a Setting to 'User.
Properties.Settings.Default.Save();
Quote:
Settings that are application-scoped are read-only, and can only be changed at design time or by altering the .config file in between application sessions. Settings that are user-scoped, however, can be written at run time just as you would change any property value. The new value persists for the duration of the application session. You can persist the changes to the settings between application sessions by calling the Save method. [^]
I found the information here useful: [^].
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
-
Bill, this is the oddest site to find things, you mention before to delete a message and repost it but there was no way to delete. Now you're suggesting I vote a thank you which I 100% agree with but I don't see anything regarding voting. Strangest site!
There are little red (down vote) and green (up vote) arrows to the left of the message you want to vote on. Just open the message and move your mouse towards the left side under the document icon and it'll show the voting arrows. At the bottom of your messages are the links to edit/delete, etc. You can use those too.
-
There are little red (down vote) and green (up vote) arrows to the left of the message you want to vote on. Just open the message and move your mouse towards the left side under the document icon and it'll show the voting arrows. At the bottom of your messages are the links to edit/delete, etc. You can use those too.