>I have several forms where the check box has no caption. It's really hard to tell when the check box has the focus.
>
>Anybody have a scheme to share that will make the check box easier to tell when it has the focus? If different colors are used,they need to stay within the users control when they change their color scheme in the control panel.
>
>It's funny how much users get upset when they cannot control the colors of an application.
>
>John Brooks
Hi John - if you do wan't to use colors - and only those that the user defines add this code (or modify it) to the Register.prg which comes with VFP.
It will allow you to read the colors straight out of the registry.
DEFINE CLASS colorreg AS registry
FUNCTION GetRGB
LPARAMETERS cItem, nR, nG, nB
LOCAL cRGB, nRetVal
cRGB= ""
nRetVal= THIS.GetRegKey(m.cItem, @cRGB, "Control Panel\Colors", HKEY_CURRENT_USER)
nR= INT(VAL(m.cRGB))
nG= INT(VAL(SUBSTR(m.cRGB, AT(" ", m.cRGB)+1)))
nB= INT(VAL(SUBSTR(m.cRGB, RAT(" ", m.cRGB)+1)))
RETURN m.nRetVal
ENDFUNC
FUNCTION ColorValue
LPARAMETER cItem
LOCAL nR, nG, nB
IF THIS.GetRGB(m.cItem, @m.nR, @m.nG, @m.nB) = 0
RETURN RGB(m.nR, m.nG, m.nB)
ELSE
RETURN 0
ENDIF
ENDFUNC
ENDDEFINE
So you can then do things like...
oColors= Createobject("colorReg") && I haven't checked this syntax
myCheckBox.forecolor= oColors.colorValue("ActiveTitle")
Run Regedit.exe from the "Run" box and then look in
HKEY_CURRENT_USER, Control Panel, Colors
to see all the colors you can use.
HTH