G
Guest
Hi,
I don't know how to retrieve the default value of user properties.
For instance, I have defined 2 user properties named TheColor and TheFont,
with the type System.Drawing.Color and System.Drawing.Font. I can access
their current values like this:
dim theColor as System.Drawing.Color = My.MySettings.Default.TheColor
dim theFont as System.Drawing.Font = My.MySettings.Default.TheColor
I have found in the SettingsProperty objects, the default value in a
serialized form :
dim theColorProperty as SettingsProperty =
My.MySettings.Default.Properties("TheColor")
dim theFontProperty as SettingsProperty =
My.MySettings.Default.Properties("TheFont")
dim defaultColorValue as String = theColorProperty .DefaultValue
dim defaultFontValue as String = theFontProperty .DefaultValue
Now, how can I build the Color and Font object containing the default values
from these SettingsProperty ? Is there a way to deserialize it ?
Thanks.
I don't know how to retrieve the default value of user properties.
For instance, I have defined 2 user properties named TheColor and TheFont,
with the type System.Drawing.Color and System.Drawing.Font. I can access
their current values like this:
dim theColor as System.Drawing.Color = My.MySettings.Default.TheColor
dim theFont as System.Drawing.Font = My.MySettings.Default.TheColor
I have found in the SettingsProperty objects, the default value in a
serialized form :
dim theColorProperty as SettingsProperty =
My.MySettings.Default.Properties("TheColor")
dim theFontProperty as SettingsProperty =
My.MySettings.Default.Properties("TheFont")
dim defaultColorValue as String = theColorProperty .DefaultValue
dim defaultFontValue as String = theFontProperty .DefaultValue
Now, how can I build the Color and Font object containing the default values
from these SettingsProperty ? Is there a way to deserialize it ?
Thanks.