Per interceptor class, die cm_MouseWheel abfängt:
Delphi-Quellcode:
type
TPageControl =
class(
Vcl.ComCtrls.TPageControl)
private
procedure cmMouseWheel(
var Message: TCMMouseWheel);
Message cm_MouseWheel;
end;
implementation
{ TPageControl }
procedure TPageControl.cmMouseWheel(
var Message: TCMMouseWheel);
var
Dir: integer;
begin
if Message.WheelDelta < 0
then
Dir := 1
else
Dir := -1;
if (Dir = -1)
and (ActivePageIndex = 0)
then
ActivePageIndex := PageCount - 1
else
ActivePageIndex := (ActivePageIndex + Dir)
mod PageCount;
Message.Result:=1;
end;