Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add en event to the queue instead of processing immediat
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01584803
Message ID:
01584816
Vues:
109
>>In validation for a field on a form I want to be able to execute the code attached to a button on the form. In certain instances, this code needs to be able to set focus to another control. You can't set focus to another control from within a valid. Is there a way to add a click event to the event queue. I though raiseevent would solve my problem, but it doesn't add it to the event queue for processing after valid is finished, it processes it immediately just as if I had called button.click(). Is there any way to add an event to execute after valid() finishes?
>
>You can set focus to another control in Valid method in at least two ways which are documented in the help for Valid method.

I know about those methods of changing focus through the valid. I should have specified that foxpro is throwing an error because the chain of event processing is leading to a different control trying to set focus to a new location on the form while the validation is firing.

I am working with an application that has several large definition screens for different items in the database. I am trying to add a "navigation" control that allows the user to quickly move to different sections of the form. So I have a custom control with a click method, and field with a valid. If the field has focus and I click on the navigation control, the field.valid fires. If the data in the field is not valid, the application displays a message indicating the problem, but the navigation.click event is also firing and trying to set the focus to another field which throws an error. I tried to work around that by adding a new method for navigating to the target, and issuing a raiseevent to call the navigate method. In my valid I can set a flag to cancel the navigation and then check that flag in the navigate method. Unfortunately, raiseevent immediately process the event instead of pushing it into the event loop to be processed in turn.

I know there are other solutions to this problem, but there have been so many times when I want to have better control over event processing, so my question is how can I programmatically trigger an event to be processed in the event loop instead of immediately?
Paul R. Moon
Business Software Solutions
paul@businessoftware.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform