Ich glaube dein Problem liegt woanders, weil folgendes funtioniert einwandfrei.
Delphi-Quellcode:
type
TForm1 = class(TForm)
Label1: TLabel;
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
private
{ Private-Deklarationen }
number: Integer;
procedure Add();
procedure Minus();
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Add;
begin
number := number + 1;
end;
procedure TForm1.Minus;
begin
number := number - 1;
end;
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
if WheelDelta > 1 then
Add()
else
Minus();
label1.Caption := inttostr(number);
end;