Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I wanna save and load my color selected by ColorPicker like this:

SaveSetting("MyApp", "Style", "Color", ColorPickerButton1.SelectedColor.ToString)

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 :(

Posted

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...:(

Posted

I would load and store the value as an Argb integer, becuase it'll be much more space efficient.

 

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...

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...