procedure TForm1.Edit1KeyPress(Sender : Tobject; var Key : Char); begin If Not (Key In ['0'..'9']) Then Key := #0; end;