Ver Mensaje Individual
  #5  
Antiguo 08-11-2012
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
franroju,

Puedes asignar este código al evento OnKeyPress del Control TEdit:
Código Delphi [-]
procedure TForm1.CheckNumberKey(Sender: TObject; var Key: Char);
begin
   If not (Key in ['0'..'9']) then Key := Chr(0);
end;
El código anterior solo permitirá ingresar números en el Control TEdit, otra opción interesante es el Control TMaskEdit con la mascara de edición 0 para permitir solo números.

Espero sea útil

Nelson.

Última edición por nlsgarcia fecha: 08-11-2012 a las 23:07:26.
Responder Con Cita