17-05-2014, 09:13 AM
تفضل جرب هدا
كود :
if Edit1.SelStart in [1 .. 5] then
if not(Key in ['0' .. '9', '.', #8]) then
begin
Key := #0;
Exit;
end;
if Pos('.', Edit1.Text) > 0 then
if (Length(Edit1.Text) - (Pos('.', Edit1.Text)) = 2) and (Key <> #8) then
Key := #0;
if Key = '.' then
if Pos('.', Edit1.Text) > 0 then
Key := #0
else if (Key = '.') and (Edit1.SelStart = 1) then
Edit1.Text := Edit1.Text + '0';
Edit1.SelStart := Length(Edit1.Text);
