Que tal amigos, tengo el siguiente codigo, este me permite ingresar solo numeros en un edit, algo asi : "99999.9999", lo que quiero es liminar la cantidad de decimales, y tambien agregar el simbolo de miles "," en la posicion correcta mientras se escribe en el edit...
Código Delphi
[-]
procedure TFrmMain.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in [#8, '0'..'9', '-', '.']) then
begin
Key := #0;
end
else
if ((Key = '.') or (Key = '-')) and (Pos(Key, (Sender as TEdit).Text) > 0) then
begin
Key := #0;
end
else
if (Key = '-') and ((Sender as TEdit).SelStart <> 0) then
begin
Key := #0;
end;
end;