Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping what is Clicked
Message
From
13/05/1998 12:26:12
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00099083
Message ID:
00099089
Views:
23
>I have a form that is used to select an employee of one of our clients. The user types in any amount of digits of the last name into a text box and presses Enter. In the valid event of the text box the employee table is searched for all matches of the letters that were entered, and if there is more than one match, a pick list is displayed. There is also a Cancel button on the form. When the Cancel button is pressed, the pick list shouldn't appear. I trap for the Ctrl-C keypress in the text box's valid event (and just return .T. if it was pressed), but if the user mouse clicks the Cancel button, the pick list comes up and the user has to pick an employee before cancelling. This wasn't a problem in the past as all the users hated the mouse. But now they are starting to use the mouse and it is an irritation.
>
>Can I trap the mouse click on the cancel button in the text box's valid event?
>
>Thank for any help,
>
>Joe

I would advise to move code from Valid to KeyPress event (for nKeyCode=13).
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform