Если с помощью функции проверять ввод данных
Код:
function TForm1.IsFloat(ch:char; st:string): Boolean;
begin
if (ch >='0') and (ch <='9') // цифры
or (ch =#13) // клавиша <Enter>
or (ch =#8) // клавиша <Backspace>
then
begin
IsFloat:=True;
Exit;
end;
case ch of
'-': if Length(st)=0 then IsFloat:=True;
',': if (Pos(',',st)=0) and (st[Length(st)]>='0') and (st[Length(st)]<='9') then
IsFloat:=True
else
IsFloat:=False;
end;
end;
То где ее вызывать если Ввод данных происходит
Код:
procedure TForm1.Edit1Change(Sender: TObject);
begin
if (Edit1.Text<>'') then Dmin:=strtofloat(Edit1.Text);
end;
..................