Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox
Message
From
04/11/2004 19:55:28
 
 
To
04/11/2004 19:47:05
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00958339
Message ID:
00958342
Views:
19
>how can i disable my keyboard except the digits,"-"negative sign and the enter keys?

One approach is to use the following in the KeyPress() event of the control:
LPARAMETERS nKeyCode, nShiftAltCtrl

* We only accept digits and - sign
IF NOT ((nKeyCode>=48 AND nKeyCode<=57) OR nKeyCode=45)
   NODEFAULT
   RETURN
ENDIF
However, this is only a start. Because, I assume you would like to allow the user to type the required keys to go back, delete, use the arrows, etc.

There are probably better approaches. Using the Format property is probably one of them.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform