Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX() Enter also applied to underlying modal dial
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01177881
Message ID:
01177935
Views:
11
>Hi Terry
>
>Thanks for your response.
>
>
>>You've got me confused here:
>
>Sorry, but so am I in regards to what is happening :)
>
>
>>1) I thought the modal form did the date-getting and validation, and MSGBX warning,
>
>Yes, your understanding is correct
>
>
>>so what do you mean: "...then Enter is passed onto my modal form and the default button Ok is also pressed"
>>2) You've oulined the scenario now can you explain more clearly what happens.
>
>Now that the MSGBX warning is displayed to the user. The user reads the message and presses Enter. This closes the MSGBX alright. But my dialog's Okay (default) button also gets pressed. As if I had press Enter twice, one for the MSGBX and second for my dialog.
>
>>3) a sample of code would help illustrate the problem, which I can't determine from your post.
>
>
IF THIS.VALUE > THISFORM.txtFromDate + 50
>   THIS.VALUE = THISFORM.txtFromDate + 50
>
>   MESSAGEBOX("...", 48, "...")
>
>   THIS.SETFOCUS()
>ENDIF
>
>I have tried to put this code in both the LostFocus() and Valid() of the txtToDate control. I have tried to change 48 to other values but no luck. I also tried to put in a CLEAR TYPEAHEAD after the message box call, no luck.

What happens if you omit the THIS.SETFOCUS()?

Have you thought of clearing the .Default property of the OK button?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform