procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if Not (Key in ['0'..'9', #8])then Key:=#0; end;