Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form template
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Form template
Miscellaneous
Thread ID:
00401520
Message ID:
00401520
Views:
44
On a form (to become my form template), I would like to change the back color of a text field when the user is entering or editing that particular field.

The following works fine on the individual field property:

In the GotFocus property:
This.BackColor = RGB ( 225, 225, 225 )

In the LostFocus property:
This.BackColor = RGB ( 255, 255, 255 )

However I would l like to set the above in all text fields programmatically and tried:

FOR II = 1 TO ThisForm.ControlCount
IF "TXT" $ UPPER(ThisForm.Controls(II).Name)
ThisForm.Controls(II).Enabled = .T. && This works!
ThisForm.Controls(II).GotFocus.BackColor = RGB ( 225, 225, 225 ) && This does not work!
ENDIF
ENDFOR

I get an error that says "Unknown member GOTFOCUS

Any hints?
One can acquire everything in solitude but character.
Stendhal (1783-1842)
Next
Reply
Map
View

Click here to load this message in the networking platform