Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress event in the form problem
Message
From
15/07/2014 00:13:28
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Keypress event in the form problem
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01603679
Message ID:
01603679
Views:
40
Hi,
I want the user when press the ESC key to quit the application.
but the following code in the Keypress event of the form not work.

It have error at the line of QUIT statement.


LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27
eMessageTitle = 'Quit'
eMessageText = "Are you want to quit ?"
nDialogType = 4 + 16 + 256
* 4 = Yes and No buttons
* 16 = Stop sign icon
* 256 = Second button is default

IF MESSAGEBOX(eMessageText, nDialogType, eMessageTitle) = 6
QUIT
ENDIF
ENDIF
/PRE>

Please advise.
Derek
Next
Reply
Map
View

Click here to load this message in the networking platform