Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
John,
I really don't know why it does not fire, but you can try the following to determine the cause.
1. Do you have a READ EVENTS active. I'm not sure, but maybe a DOEVENTS can't be processed without a READ EVENTS.
2. Try if the Cancel button still does not react when the process is not active. IOW, DO FORM myProcessForm, and try if the cancelbutton sets the flag
3. Put a WAIT WINDOW in the click event of the cancel button, to determine when the click event is fired.
4. I assume you did check if the click even contains a THISFORM.CancelProcess = .t.
Maybe you can use the SET COVERAGE TO log.txt to determine what is going wrong. Maybe the scan iterates trough the records to slowly, so MDOWN() does not evaluate to .t. In this case it might help to hold the mouse down a little longer.
The described method gets better when the MDOWN OR CHRSAW expression is evaluated more frequently. OTOH, it the expression if evaluated only one or two times a seconds, it might not be effect enough.
HTH,
Walter,
>Hi,
> I have tried your suggestions
>
>>>Some suggestions though,
>>>1. Add some code to handle ESC as well.
>>>2. Let the click event of the cancel button set a flag (e.g. property on form)
>
>
>However, it still doesn't work. It seem the buffon.click event is not fire, therefore, the "CancelProcess" flag is .F. all the time.
>
>How to make the event fire? Why does it not fire?
>
>Thank you
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement