Ver Mensaje Individual
  #2  
Antiguo 20-09-2003
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Un TEdit lmitado para entrar números
Pon este código en el evento OnKeyPress de tu TEdit y sólo admitirá números:
Código:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
          begin
            if ( StrScan('0123456789.-',Key) <> nil ) or
               ( Key = Char(VK_BACK) ) then { BackSpace Key }
            begin
              {Aqui tu tratamiento normal del evento}
              {Here the normal event treatment}
            end
            else
              Key := #0;
          end;
Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita