Can someone please tell me what this vb color would be in RGB: &H8000000F&. It is the button face color.
Printable View
Can someone please tell me what this vb color would be in RGB: &H8000000F&. It is the button face color.
Button Face is a system colour, which means you need to do a lookup into the system colour table. For that you need the GetSysColor API. The last byte of a system colour constant contains the index you need. So for &H8000000F&, it would be Hex F = 15. For Button Text (ForeColor property, typically &H80000012&) it would be Hex 12 (18). Once you have the colou convert it into the RGB components.
VB Code:
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long Dim lngColour As Long Dim intRed As Integer Dim intGreen As Integer Dim intBlue As Integer lngColour = Form1.BackColor If lngColour < 0 Then 'Check if it is a system colour 'get the index into the colour table lngColour = lngColour And Not &H80000000 lngColour = GetSysColor(lngColour) End If intRed = lngColour And 255 intGreen = lngColour \ 256 And 255 intBlue = lngColour \ 65536 And 255