Mouse Wheel on TppViewer - Scrolling Reports and Moving Forward Page Numbers
I?m currently using a TppViewer on a customized Print Preview Form.
Well, I want to know how can I handle the Mouse Wheel messages to Scroll Up
and Down the Report. I have tried the OnMouseWheelUp of TForm with
TppViewer.ScrollBy with no success.
Also, is it possible to, when the user presses the Mouse Wheel and scroll it
up and down, to move forward and reward the pages of a report?
Thanks in advance
Murilo
Well, I want to know how can I handle the Mouse Wheel messages to Scroll Up
and Down the Report. I have tried the OnMouseWheelUp of TForm with
TppViewer.ScrollBy with no success.
Also, is it possible to, when the user presses the Mouse Wheel and scroll it
up and down, to move forward and reward the pages of a report?
Thanks in advance
Murilo
This discussion has been closed.
Comments
The Designer and the built-in preview dialog include support for the mouse
wheel. They both use the TppPreview class (see ppPreview.pas) which manages
the Viewer, Toolbar, Outline, and TextSearch controls that comprise the
ReportBuilder preview controls.
One solution is to descend from the TppPreview class.
The other solution is to implement the FormMouseWheel event-handler as shown
here...
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
ppViewer1.ScrollBox.VertScrollBar.Position :=
ppViewer1.ScrollBox.VertScrollBar.Position - (WheelDelta div 5);
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com