Noch nicht perfekt, aber umsonst:
Delphi-Quellcode:
procedure Normalize(e: TEdit);
var
iSelStart, iSelLength: Integer;
begin
with e do
if Copy(Text, 1, 1) = DecimalSeparator then
begin
iSelStart := SelStart;
iSelLength := SelLength;
Text := '0' + Text;
SelStart := Succ(iSelStart);
SelLength := iSelLength;
end;
end;
procedure TDemoForm.EditChange(Sender: TObject);
begin
Normalize(Sender as TEdit);
end;
Grüße vom marabu