

Instead of the RRGGBB notation that you find there, VB 6 uses BBGGRR notation, or &H00BBGGRR&, the same as the native Win32 COLORREF structure where the low-order byte is red, rather than blue. It's also worth noting that hexadecimal literals in VB 6 will not be equivalent to those that you are probably familiar with from the web and HTML programming. The value 65280 is too long to fit in an Integer, and when it overflows that data type, VB 6 wraps it around again, producing -256. That also explains why you're seeing a value of -256 instead of the 65280 that you expect. Putting the ampersand ( &) after the numeric literal accomplishes this. The trick is that the value needs to be declared as a Long, rather than an Integer. Of course, VB 6 automatically collapses it to this, which still works just fine because the two values are completely equivalent numerically: Const COLOR_GREEN = &HFF00&

Have you tried the literal &H0000FF00&? The following code works just fine for me: Const COLOR_GREEN = &H0000FF00&
