Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP:Changing colors in TEXTBOX
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00006108
Message ID:
00006111
Views:
53
>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...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform