procedure TGetFeeFrm.edt1KeyPress(Sender: TObject; var Key: Char);
begin
if not ((key >= '0') and (key <= '9')) then
if ((key <> '.') and (key <> #8)) or
((key = '.') and (pos('.', Trim(edt1.text)) > 0)) then
key := #0;
end;
begin
if not ((key >= '0') and (key <= '9')) then
if ((key <> '.') and (key <> #8)) or
((key = '.') and (pos('.', Trim(edt1.text)) > 0)) then
key := #0;
end;
if not key in [0..9] then
key=#0;
if not(key in ['0'..'9']) then
key:=#0;
if not(key in ['0'..'9','#13','#8']) then
key:=#0;
怎么都不排除删除和回车呢?
begin
if not(key in ['0'..'9','#13','#8']) then
if ((key <> '.') or (pos('.', Trim(edt1.text)) > 0)) then
key := #0;
end;
begin
if ((Ord(Key)>=48) and (Ord(Key)<=57)) then exit;
Key:=chr(0);
end;