troubleshooting Question

Delphi 7 QuickReport with MouseWheel support

Avatar of Frits2
Frits2 asked on
Delphi
11 Comments1 Solution2406 ViewsLast Modified:
Hello Experts

I need the QuickReportForm to respond to the MouseWheel, now I found the next code snipe on this site from expert pcsentinel. Somehow I can't get this code working. using Delphi 7 & QuickReport 4.05. No errors messages but QRform does not respond on the MouseWheel.
what do I do wrong?
if there is an other solution I am happy to hear it
Many thanks,
Frits2

Type
    procedure MouseWheelHandler(var Message: TMessage); override;
    procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
      MousePos: TPoint; var Handled: Boolean);
    procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
      MousePos: TPoint; var Handled: Boolean);

implementation
procedure TForm1.MouseWheelHandler(var Message: TMessage);
begin
with Message do
  Result := Perform(CM_MOUSEWHEEL, WParam, LParam);
end;

procedure TForm1.FormMouseWheelDown(Sender: TObject;
  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
begin
  QRForm.VertScrollBar.Position := QRForm.VertScrollBar.Position + 50;
  Handled:=true;
end;

procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
begin
  QRForm.VertScrollBar.Position := QRForm.VertScrollBar.Position - 50;
  Handled:=true;
end;
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros