VCL Delphi

Function rakam(Key:Char):Char;
Begin
IF (Key>='0') And (Key<='9') Or (Key=#8) Or (Key=#13) Then
Begin
Result:=Key;
end
else Result:=Chr(0);
end;
//Kullanimi:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
Key:=rakam(key);
end;