Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does my Valid() code operate differently to click()
Message
 
À
15/12/1999 19:37:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00304456
Message ID:
00304459
Vues:
28
>I have some code in a VALID method of an option group. The code concludes with a SETFOCUS on a Grid.
>
>When the code is in the VALID method, it causes the GRID.AFTERROWCOLUMNCHANGE method to run.
>
>When it is place in the CLICK method of the option group, the GRID.AFTERROWCOLUMNCHANGE method does not run. The code is running and the focus is left on the Grid, but the method from the Grid does not.
>
>Anyone know why?
>

David,

Calling a SetFocus form a Valid is not allowed after VFP 5.0 and in 6.0 it causes an error telling you that. Call the setfocus either form the LostFocus or from the click.

Ok, I know your question si why does the grid's AfterRowCool event fire in one situation and not in the other. Well, here's an educated guess. When you setfocus is in teh vlaid it places focus in teh grid, but then the default behavior of the vlaid steps in and moves control to the next tab ordered object after the option button that was clicked which remvoes focus from the grid, then for some reason (perhaps teh grid is the next object in the tab order) focus moves again to the grid. So with code in the valid the grid gets focus, loses focus, gets focus again whihc is probalby why the event is firing.

When the setfocus is in the click the focus isn't jumping all over the place on you so the event does not fire.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform