Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically Changing the ForeColor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00653051
Message ID:
00653236
Vues:
16
>Stupid Question.
>
>How can I change the color of the text in a text box programmatically. The only way I have been able to change the color is by adding the 3 RGB values together so red would be 255 since it is 255,0,0. Blue is 0,0,255 so how would I code this.

Actually, the internal order of colors in VFP is BGR, so if you want to avoid using RGB() function, you can simply set your color numbers in hex - but in BGR numbers. Just try

?rgb(nRed, nGreen, nBlue) picture "@0"

and you'll see why you get 255 for red (255, 0, 0) and 65280 (0x00ff00) for green (0, 255, 0).

So, you can set your forecolor to red using this syntax:
this.forecolor=0x0000ff

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform