I'm writing a Windows Forms application in Visual Studio, and I have a user-scope application setting of type string
that has a default value, which is specified at design-time using the Project Designer's "Settings" page.
In my application, I have a dialog where the user can change the setting to a custom value. The dialog also has a checkbox labeled "Use Default Value". If that box is checked, I want the setting to revert to the application default.
I managed to do this by "statically" by setting it to the current default value like so: My.Settings.MyStringSetting = My.Settings.Properties.Item("MyStringSetting").DefaultValue
. However, this isn't ideal because it's not persistent. If the application default changes due to an update, the user value will still be set to the old default value.
I would like to know if there is a way to simply remove the user setting override from the user.config file altogether, as My.Settings.Reset does, but for this one single setting. So that checking "Use Default Setting" will hold true even if the application default gets updated.
Is this possible?