procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key in ['0'..'9'] then
    showmessage('ok');
end;