Hola:
Por la fecha de este hilo quizás ya sea demasiado tarde pero ahí va:
Esto funciona para edit (excepto creo recordar, si se ecribe en el edit con "copiar".. "pegar")
En su evento OnKeyPress
Código Delphi
[-]
procedure TFLibros.ESigna1EKeyPress(Sender: TObject; var Key: Char);
var
i: integer;
begin
if ( StrScan('0123456789.'+chr(7)+chr(8), Key) = nil ) then Key := #0;
for i := 1 to length(ESigna1E.Text) do
if ( copy(ESigna1E.Text,i,1) = '.' ) and not ( StrScan('.', Key) = nil ) then Key := #0;
end;
Mira a ver si con DBEdit funciona algo parecido
Código Delphi
[-]
procedure TFLibros.ESigna1EKeyPress(Sender: TObject; var Key: Char);
var
i: integer;
begin
DBEEdit1.Field.ValidChars :=['0'..'9','.']
for i := 1 to length(DBEEdit1.Text) do
if ( copy(DBEEdit1.Text,i,1) = '.' ) and not ( StrScan('.', Key) = nil ) then Key := #0;
end;
Un saludo.