Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP:Changing colors in TEXTBOX
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00006108
Message ID:
00006111
Vues:
41
>My form has a textbox, a grid, and navigation
>buttons (Top, Prev, Next, Last)
>I want the text in my textbox to change on the fly.
>Blue on white if boy, Red on white if girl.
>After I ADD OBJECT txtName AS TextBox WITH...
>I'm doing a:
>
>mNameCol=iif(names.gender='boy',16711680,65535)
>txtName.forecolor=mNameCol
>
>For some reason this isn't working. I have been
>toying with it and can get it to work first pass.
>However, when I click buttons:
>
>(NavButton is a COMMANDBUTTON class.)
>
>define CLASS FirstButton AS NavButton (go to top)
> Left = 9.0
> Picture = "top.bmp"
> procedure Click
> NavButton::Click
> GO TOP
> mNameCol=iif(names.gender='boy',16711680,65535)
> txtName.forecolor=mNameCol
> thisform.Refresh
> endproc
>enddefine
>
>...the 'txtName.forecolor=mNameCol' bombs out saying
>"txtname is not an object"
>
>Can anyone tell me how (and where) to do this??
>Any help would be great!
>thnx
>John

you need to say THISFORM.txtName.forecolor=mNameCol
in any case, i'd put vlad's code in the txtName refresh code...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform