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