What is the correct way to save and restore colors from the registry? I need to save the forecolor and backcolor and this is currently what I have:
To Save:
Code:
// Softwarekey is a connection to local_user in registry
Color tempColor = control.ForeColor;
softwareKey.SetValue("FontColor",tempColor.ToArgb());
To Restore:
Code:
Color tempColor = Color.FromArgb(Convert.ToInt32(softwareKey.GetValue("FontColor",Color.Gray)));
control.ForeColor = tempColor;
It doesn't seem to be the correct way but it is the only way I could come up with to do this. Any ideas?