Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form template
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00401520
Message ID:
00401527
Vues:
17
>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 )

It's an event, not a property.

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

Also an event, not a property

>
>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!

Yep - you can't assign a value to an event; something which contains code. You need to create a sibclass of the textBox that has the added code in the events, and use that rather than the default textbox.

> ENDIF
>ENDFOR
>
>I get an error that says "Unknown member GOTFOCUS
>
>Any hints?
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform