Accept only numerical

 



Procedure TForm1.Edit1KeyPress ( Sender : TObject ; Var Key : Char ) ;

Begin

   If ( StrScan ( '0123456789.-' , Key ) <> Nil ) Or

      ( Key = Char ( VK_BACK ) ) Then { BackSpace Key }

   Begin

    {Here the normal event treatment}

   End

   Else

      Key := #0 ;

End ;

Back Home Foward