Hallo,
eine kleine Anregung - im Sinne von Beitrag #2:
Delphi-Quellcode:
function IsValidKey(s: String): Boolean;
var
number, index: Integer;
begin
Val(s, number, index);
Result := (index = 0) or (s = '')
or ( (index > 1) and (s[index] in ['a'..'z']) and (index = Length(s)) );
end;
procedure TDemoForm.EditChange(Sender: TObject);
begin
with Sender as TEdit do
if IsValidKey(Text)
then Color := clWhite
else Color := clYellow;
end;
Grüße vom marabu