Harvey said:
Hi. Say, in VB6:
Const CLR2 As Long = &HFFF0DC ' light blue
AnyObj.BackColor = CLR2
- How is the equivalent one in C#?
Thanks,
<Harvey Triana />
VB6 colors are BBGGRR, while .NET colors are RRGGBB. Also a .NET color
needs a value for the alpha channel, so you can create color from the
code, then create a solid color from that color:
Const colorTwo As Integer = &HDCF0FF
AnyObject.BackColor = Color.FromArgb(255, Color.FromArgb(colorTwo))
You can also create a color from the separate red, green and blue
components. Then you don't have to specify the alpha value:
AnyObject.BackColor = Color.FromArgb(&HDC, &HF0, &HFF)