Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid event problem
Message
From
02/04/2008 13:12:37
 
 
To
01/04/2008 17:05:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01307503
Message ID:
01307685
Views:
12
>Ok, this should be simple but of course it can't be.
>
>I have a valid event I use to check for the existance of an item in our inventory masterfile. This event is just for a warning, not to ever stop someone from entering 'bad data'.
>
>Example:
>
>Valid event
>
>Select Icitem
>Locate for icitem.item = this.value
>if EOF()
>    =messagebox("Warning! This item is not in the master file")
>endif
>
>
>Simple enough right?
>
>Well the problem is that I have a button. If you happen to be in the field that is getting validated and you click the button, the valid event fires; but then the code in the click method of the button never runs. For some reason the valid event code is cancelling out the code in the button.
>
>Any ideas? What am I missing here?
>
>Greg

The commandButton.click event occurs
only if the coordinates nXCoord, nYCoord of MouseUp event are internal to commandbutton.
When VFP create a MESSAGEBOX in valid,
coordinates nXCoord, nYCoord of commandbutton.MouseUp become negative,
and then the click event is not fired.
A VFP Bug.

try this:
- set focus into the valid event object
- hold down the mouse left click into the button
- Messagebox appears
- press ENTER
- Messagebox go out.
- CommnandButton.MouseUp it is fired ( But the left mouse button is still down !!! )
Then the CommandButton.MouseUp workaround is not usable.

You can play with BINDEVENT() to windows messages to find a workaround ...
Previous
Reply
Map
View

Click here to load this message in the networking platform