Ver Mensaje Individual
  #3  
Antiguo 20-09-2003
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Una forma muy parecida a la de marcoszorrila pero que me parece un poquito más clara:

Código:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key in ['0'..'9', '.', '-', Char(VK_BACK)] then
  begin
    { Tratamiento normal del evento }
  end
  else
    Key := #0;
end;
// Saludos
Responder Con Cita