The problem is that you assign one of the system colors. In this case (probably) vbButtonFace which has a value of &H8000000F. Which isn't actually grey.
To change this behaviour add the following declaration to the classNow change the Property Let Color procedure into the followingVB Code:
Private Declare Function GetSysColor _ Lib "user32" ( _ ByVal nIndex As Long) As LongYou should now get the correct color.VB Code:
Public Property Let Color(ByVal nNew As Long) Dim sHex As String m_Color = nNew If m_Color < 0 Then ' A system color. Convert it to correct color sHex = Right$(Hex(m_Color), 4) m_Color = CLng("&H" & sHex) m_Color = GetSysColor(m_Color) End If End Property
Thank you so much for pointing this out.




Reply With Quote