Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
In VB6, ForeColor could translate into a single numeric value, which I then saved into my DB. With VB.Net, I still need to save ForeColor, however, I can't cast a Color to a number or vice versa. Is my only option to save the individual R, G, and B values of a control's .ForeColor property?
Posted

I was close. I had ToArgb worked out, but for the other I had...

 

Label1.ForeColor.FromArgb(#)

 

... which I thought should work. But I see now that FromArgb simply returns a value and does not alter the object, which is why it should be as you posted with...

 

Label1.ForeColor = System.Drawing.Color.FromArgb(#)

 

Thanks. :)

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