Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check Boxes
Message
De
21/07/1998 00:43:29
 
 
À
20/07/1998 23:32:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00119481
Message ID:
00119590
Vues:
23
>>>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		&& pass colors by reference
>>		* eg eNum= o.GetRGB("Hilight", @m.nR, @m.nG, @m.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
>>		* eg myColor= o.ColorValue("Hilight")
>>		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	&& black
>>		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
>
>
>I have an app that runs on Win95/98 and NT, how different will the registry be on an issue like this?
>
>John

Shouldnt be a problem at all
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform