просто запрети ввод не числовых символов
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
case Key of
'0'..'9':;
#8:;
',','.': if (Pos(',',Edit1.Text) = 0) and (Length(Edit1.Text) > 0) then
Key:=','
else Key:=#0;
else Key:=#0;
end;
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
case Key of
'0'..'9':;
#8:;
',','.': if (Pos(',',Edit1.Text) = 0) and (Length(Edit1.Text) > 0) then
Key:=','
else Key:=#0;
else Key:=#0;
end;
end;
раскрыть ветку (1)
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not( Key in ['0'..'9', #8, '-', ','])then
Key := #0;
end;
Вот так проще можно, мне посоветовали) Ну чисто если интересно ^_^
begin
if not( Key in ['0'..'9', #8, '-', ','])then
Key := #0;
end;
Вот так проще можно, мне посоветовали) Ну чисто если интересно ^_^