Load and Save Settings

VBOfficer

Newcomer
Joined
Jan 22, 2009
Messages
24
Hi,
I wanna save and load my color selected by ColorPicker like this:
Visual Basic:
SaveSetting("MyApp", "Style", "Color", ColorPickerButton1.SelectedColor.ToString)
Visual Basic:
ColorPickerButton1.SelectedColor = Color.FromName(GetSetting("MyApp", "Style", "Color"))
The color I am loading from the settings does not get loaded correctly.
Perhaps in converting or something else.
Please help me :(
 
Thank you for wrong advise!
In this case, the problem is not with method of saving / loading data.
The problem is that when I save the .SelectedColor of Color Picker control as String, and need to load it back, how can I really convert String to Color?
The convert method I am using won't work!!!
PS in my real application I am saving the data to a database...:(
 
I would load and store the value as an Argb integer, becuase it'll be much more space efficient.

Code:
System.Drawing.Color c = new System.Drawing.Color()
c = System.Drawing.Color.White
Save("color", c.ToArgb())
System.Drawing.Color.FromArgb(Load("color"))

PS, you are welcome for the wrong advice...
 
Back
Top