also mein Programm sieht wie folgt aus:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
procedure FormVKKeyPress(Sender: TObject;
var Key: Char);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
...
procedure TForm1.FormCreate(Sender: TObject);
begin
form1.onkeypress := FormVKKeyPress;
.....
end;
procedure TForm1.FormVKKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13
then Key := #0;
if not (Key
in ['
0'..'
9', #8])
then Key := #0;
end;
end.
aber es funzt nicht... ich möchte nur die Tasten Backspace und 0-9 zulassen.
was ist falsch?