PDFiumVCL 文件

OnMouseWheel event

此 API 條目保留識別符號、簽名、程式碼塊和 PDF 術語的原始形式。
Component: TPdfView  ·  Unit: PDFium
Fired when the wheel is rotated over the view.

Syntax

property OnMouseWheel: TMouseWheelEvent;

Description

Fired when the wheel is rotated over the view. The Sender parameter references the TPdfView instance that raised the event, so a single handler can serve multiple views by inspecting Sender.

Typical uses include: implement Ctrl+wheel zoom or replace the default page scroll. Because the handler runs on the VCL main thread, you can update form controls and call other VCL APIs directly.

Handlers must return quickly — PDFium rendering and form filling occur on the same thread, and any delay here postpones the next page repaint.

Remarks

Example

procedure TForm1.PdfViewOnMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
  // implement Ctrl+wheel zoom or replace the default page scroll
  Caption := Format('OnMouseWheel on page %d', [PdfView1.PageNumber]);
end;

See Also

OnClick, OnPageChange, OnMouseDown, PageNumber