vb hex color codes

Viewed 53203

I want to do this:

    Const COLOR_GREEN = &H00FF00
    Me.Label1.BackColor = COLOR_GREEN

There is a problem however in that vb automatically decides to convert &H00FF00 to &HFF00 so I get this instead:

    Const COLOR_GREEN = &HFF00
    Me.Label1.BackColor = COLOR_GREEN

The decimal value COLOR_GREEN is now -256 instead of 65280 and so the background is black instead of green! This is annoying as I can perfectly well set the color in form design mode using #00FF00.

What is the equivalent in vb of setting a color to #00FF00 in the form design mode?

3 Answers
Related