vbgraytext is a system color, while the property forecolor seems that returns a RGB color (in your case 0x99A8AC).
try converting vbgraytext in the real RGB color using the GetSysColor API:
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
if sprd.forecolor = GetSysColor(vbGrayText And &hFFF)
to see if that works.
But sometimes it doesn't, I saw already controls that do not set exactly the color you ask for, like the MSFlexGrid. This is why I never use the color to check program settings, but I use a local internal data.
|