Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form/Messagebox call in Valid kills Click
Message
De
16/12/2019 14:55:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Form/Messagebox call in Valid kills Click
Divers
Thread ID:
01672274
Message ID:
01672274
Vues:
139
Running into something weird that I haven't encountered before, but maybe I just haven't run into this situation. I have code called by a textbox's Valid method that pops up a form to ask the user to make a choice. If the user clicks a button while focus is on the textbox, the form pops up as expected, but then while focus lands on the button, the Click method doesn't fire.

A few things I've done to track this down:

1) I've created a much simpler form to test with and confirmed that I see the problem there as well.
2) I've used Event Tracking and I see that the button's MouseDown fires, but not MouseUp or Click.
3) I've also tried replacing the form call with a call to MessageBox() to confirm that it's not something about my form that's causing this problem. Same issue.
4) I've tested using only the keyboard in the pop-up form or messagebox, not the mouse, and it doesn't make a difference.

So is this a known issue that I've just been lucky enough not to encounter before?

Any thoughts about how to work around it? I'm thinking that I'll need to set a property in the textbox Valid before calling the pop-up and then in GotFocus of every button on the form, check that property and, if it's set, do something to fire the Click code and clear the property. I'll need a way to clear the property in cases when we're leaving the textbox and headed anywhere other than a button. That one is trickier, but it looks like the button's When fires before the textbox's LostFocus, so maybe a second property to indicate that we're headed for the button.

That all sounds really ugly, so if anyone has other ideas, I'd love to hear them.

Tamar
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform