Add User settings to My.Settings at Runtime

G

Guest

Does anyone know how to add user scoped settings to My.Settings at runtime?

I know how to use the 'My Settings' designer to add user settings at design
time. I also, know how to create a class that inherits from the
ApplicationSettingsBase where you can define your own settings with their
default values, at design time. But, these are all done at design time which
aint want i need.

I've tried using the My.Settings.Properties.Add method, but that doesn't
seem to work? is it supposed to?

I'm guessing i'll need to have a user scoped collection setting that allows
me to add settings to it and then serializes the collection. This seems a bit
wrong though.

Cheers
 
M

MSMVP KenLin for VB.NET

Dear Shane,

As I think, there are 2 ways to add user Setting for my.settings, but both
are under design time,

1) using Project Designer
2) Properties Windows

And there is a sentence from the .NET Documentation,
========
The My.Settings object provides access to the application's settings and
allows you to dynamically store and retrieve property settings and other
information for your application
========

--
Hope this help and welcome to reply the testing result.

Regards
Ken Lin, Kam Hung
Founder and VP of Hong Kong .NET User Group(http://HKNetUG.com)
MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
Microsoft Community Star(Hong Kong & Taiwan)
Microsoft Most Valuable Professional(.NET since 2003)
MCT2004 & 2005
 
G

Guest

So, you're saying there is absolutely no way to add settings at runtime?

My reason for needing this feature is to store settings for a pc's mixer
controls (ie. master volume, wave volume etc). I basically enumerate all
mixer controls and store their settings. Available mixer controls vary from
pc to pc, so there is no way i can know their settings at design time.

Cheers
 

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

Top