Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Commandbutton Click Doesn't Fire After Textbox Validatio
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00786042
Message ID:
00786045
Vues:
17
My guess is you are having to click the button twice because the first click clears the wait window.

Anyway that aside, an alternative would be to put your validation on the commandButton (move it out of the textbox's valid event)


>I tried this on VFP 6 (SP5), 7 and 8.
>
>Create a new form, add a textbox and a commandbutton. In the Valid() event of the textbox put:
>
> IF .t.
> WAIT WINDOW 'Hello'
> ENDIF
>
>In the Click() even of the commandbutton put:
>
> WAIT WINDOW "Did Command"
>
>Now run the form, be sure the cursor is in the textbox, and then click on the commandbutton.
>
>You should get the wait window showing the "Hello" message, but the commandbutton's Click() event doesn't fire. The "Did Command" message never shows. But the command button does receive the focus. (Clicking it again runs the Click() code as expected - but you have to click it twice to get it to work properly.)
>
>I need to show a validation message when the user leaves the textbox and one of the ways the user can leave the textbox is by clicking on a commmand button. When a user clicks on the commandbutton, the message shows up but the command button's code is never executed.
>
>Is this a bug? I can't think of any reason why this would be by design.
>
>Does anyone have any ideas for a work around?
>
>I need to be able to detect when the button is clicked but none of the commmandbutton events seem to fire before the textbox's valid event and after I only can get a GotFocus() event on the commandbutton. But I don't know if the commandbutton was reached by a tab-through or a mouse-click.
Mathias Banda

Time is longer than a rope.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform