procedure TForm.EditKeyPress(Sender: TObject; var Key: Char); begin if not(Key in ['0'..'9',chr(8),' ','A'..'Z','a'..'z']) then Key:=#0; end;