Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox
Message
De
04/11/2004 19:55:28
 
 
À
04/11/2004 19:47:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00958339
Message ID:
00958342
Vues:
20
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform