Ver Mensaje Individual
  #2  
Antiguo 17-06-2011
Rofocale Rofocale is offline
Miembro
 
Registrado: mar 2010
Posts: 182
Reputación: 15
Rofocale Va por buen camino
me olvidaba uso este codigo para poder ingresar los numeros bueno los decimales en el edit pero como les mencione los numeros de arriba no funcionan a ver si me pueden ayudar
Código Delphi [-]
Var i: Integer;
    pos: Cardinal;
begin
   i:=0;
//Permite que desepues de se digite el . solo se puedan ingresar 2 Registros Mas
  if ( StrScan('0123456789.'+chr(7)+chr(8), Key) = nil ) then  Key := #0;
 // cambia el punto decimal por coma
  if key = '.' then key := '.';
  //controlar entrada una sola coma
  for i := 1 to length(txtPrecio1.Text) do
    if ( copy(txtPrecio1.Text,i,1) = '.' ) and not ( StrScan('.', Key) = nil ) then  Key := #0;

 with Sender as TcxTextEdit do
  begin
   pos := System.Pos('.', Text);
   if not LongBool(Pos) then Dec(Pos);
   Properties.ReadOnly := not (Key in ['0'..'9', '.', #8]) or
               (Pos <> $FFFFFFFF) and (Key = '.') or
               ((Key <> #8) and (Pos < (SelStart - 1)));
  end;
Responder Con Cita