Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lostfocus (or valid) calls frm --> wierdness
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Divers
Thread ID:
01402232
Message ID:
01402233
Vues:
70
Can you please show the code? Is it newobject() or DO FORM type of code?

>I have a form with a save button and container. The container is for doing lookups. It contains a textbox.
>
>The lost focus of the container calls a lookup form. If the user cancels out of the lookup form, it sets focus back to the textbox.
>
>I’m getting strange behavior:
>I put a blank in the textbox, and click save. It correctly shows a messagebox.
>
>I put bad value (‘asdfksdj’) in the textbox, and click save. The search form comes up, I cancel, focus returns to the textbox.
>
>I click save again, and the search form comes up and closes by itself in .1 seconds, and the bad value is saved.
>
>I spent a few days playing with it. The form is definitely modal. All the memvars are the same the first time and the second time it is called. It just behaves differently.
>
>I tried using valid instead of setfocus, but it didn’t help.
>
>Then I made two empty test forms to play with.
>
>When I click on the save button, the lookup form comes up. I cancel, and it goes back to the textbox, no problem.
>
>Lets try that again:
>
>When I click on the save button, the lookup form comes up. I click OK, and focus goes to the save button that I clicked on. However, the click event does not fire. It has been swallowed by the search form. I logged events and there it is, form.click.
>
>So, I have a model form that acts modeless the second time you call it.
>I have a click event that doesn’t fire.
>I also sometimes notice that the lostfocus and valid events fire twice.
>
>First I’d like to know why this is happening. Failing that, a workaround would do.
>
>Tracking which was the last control hit, and using this info in the save button’s gotfocus to manually call the click is really ugly.
>
>Other ideas?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform