procedure TForm4.edt1KeyPress(Sender: TObject; var Key: Char); begin if edt1.Text = '0' then if Key = '0' then edt1.Text:= ''; end;