Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Commandbutton Click Doesn't Fire After Textbox Validatio
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00786042
Message ID:
00786971
Views:
21
Thanks for the suggestions.

I tried the first and it did not work. It seems that the MouseDown event never fires for the commandbutton so the flag is never set.

I think it has something to do with the focus leaving the form when VFP pauses for the WAIT WINDOW or goest to a MESSAGEBOX().

I have been trying to use the form's ActiveControl property to test if the commandbutton is the active control when the focus returns from the MESSAGEBOX() window to the form, but whenever I reference the ActiveControl property I get an error saying it is not an object. I cant seem to get ActiveControl to work as documented. Is this another bug? Do you know?

Form.Activate:

IF VARTYPE(this.ActiveControl)="O" AND this.ActiveControl.name="Cmd1"
thisform.cmd1.Click()
ENDIF

Always returns an error.

I am unfamiliar with the MDOWN() function and VFP6 "Help" was NOT. Where would that code go?

Thanks for your help and ideas.


>If you change the WAIT WINDOW in the Valid to be WAIT WINDOW "your message" NOWAIT NOCLEAR the Click fires just fine. You will need to do a WAIT CLEAR to get rid of the message.
>
>You could have a flag property that you set in the MouseDown event and check if that property is set in the Click (clearing it also).
>
>*Init
>this.AddProperty("MouseUsed")
>
>*MouseDown
>this.MouseUsed = .t.
>
>*Click
>IF this.MouseUsed()
>  this.MouseUsed = .f.
>  *
>  * Do whatyou need to do if clicked by the mouse
>  *
>ENDIF
>
>Or you just could use the MDOWN() function.
>
>IF MDOWN()
>  *
>  * Do whatyou need to do if clicked by the mouse
>  *
>ENDIF
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform