Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableUpdate() Problem
Message
De
16/10/1998 09:47:16
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, Californie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00147398
Message ID:
00147454
Vues:
35
Just a little potential gotcha...

I have also encountered this problem. The solution below works fine UNLESS the active control is a grid. If the active control is a grid then you have to actually find the active control INSIDE the grid (activecolumn) instead.

Otherwise the grid gets the focus in the example below but the Valid of the control that is being edited still never fires.

I have some code examples if you need further information.

Eric Shaneson
Cutting Edge Consulting

>Gilles,
>
>The reason you see the behavior you do is that a toolbar NEVER gets focus, so the textbox never loses focus. The controlsource is updated by the textbox after its valid fires, which occurs when it loses focus. Since in hasn't lost focus it hasn't updated its controlsource. The solution is to get VFP to make the textbox lose focus. You can do this by setting focus to the same textbox with code like this at the beginning of the toolbar button's code.
>
>
>IF TYPE("_screen.ActiveForm.ActiverControl.Name") = "C"
>   IF PEMSTATUS(_screen.ActiveForm.ActiveControl, "Setfocus",5)
>      _screen.ActiveForm.ActiveControl.SetFocus()
>   ENDIF
>ENDIF
>* The rest of your button code here
>
Eric Shaneson
Cutting Edge Consulting
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform