Como inserir somente numeros em um edit

Delphi

10/01/2007

Gostaria de saber como que eu fasso para inserir somente numeros em um edit. Tentei usar o envento onKeyDown zerando o valor de Key mais ñ funcionou


Ruyoutor

Ruyoutor

Curtidas 0

Respostas

Titanius

Titanius

10/01/2007

Tente no OnKeyPress:
if not (Key in [´0´..´9´, 8]) then Key := 0;


[]s


GOSTEI 0
Ruyoutor

Ruyoutor

10/01/2007

Valeu meu amigo!

Muito obrigado pela ajuda

eu estava fazendo assim:

if not(Key >= #96)and(Key <=105) then
  Key := 8



GOSTEI 0
POSTAR