Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the response of the enter key

Status
Not open for further replies.

kate

Programmer
Nov 19, 2001
51
US
I have a program that brings up a browse window for users to select a record from and then that records information will display on the screen. However, instead of using the escape key or closing the window with the x, I want the users to be able to double click on the record or hit the enter key with the record selected in order to exit the browse window.

Is there a way to assign to the enter key or the double click action, the same response that the escape key would give?

Thanks
 
How about:

ON KEY LABEL enter KEYBOARD '{ESC}'
BROWSE NOAPPEND NOEDIT NODELETE NOMENU
ON KEY LABEL enter

 
double click on the record or hit the enter key with the record selected in order to exit the browse window

I know that users ask for some peculiar things but you'd get better control of the situation if you displayed the data as a grid inside a form. That would allow you to add a conventional "Close" button.

Geoff Franklin
 

Yes, I agree with Geoff. A grid would be much more flexible. As well as having a Close button, you could write code in the Keypress event (to respond to Enter) or the DblClick event.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top