Search code examples
.netvb.netapplication-settings

Add name in My.Settings


How to add a new name in My.Settings?
So far, I've learned how to read and edit values in it, but how can I add another row/name at run-time?

Something like:

My.Settings.AddName.String("foo1")
My.Settings.Save()
My.Settings.foo1 = "fooNew"

I can't see such on the web.. Thanks
EDIT: will be used for the name,text and location of dynamically added buttons.
SeeThisLink


Solution

  • The My.Settings application settings are compiled into your assembly. The properties cannot be altered at runtime because of this. Expecting new settings to be available at runtime through the My.Settings property will not be possible. You would need to resort to more rudimentary techniques like those highlighted by this MSDN question.