Könnte ungefähr so aussehen:
Delphi-Quellcode:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8,#44,#45]) then Key := #0;
if (length(edit1.Text)>0) and (Key in [#45]) then Key := #0;
if (pos(#44,edit1.Text)>0) and (Key in [#44])then Key := #0;
end;
Gruß Lantis