PDFiumVCL Docs

ShowHint property

Denna API-post behåller identifierare, signaturer, kodblock och PDF-termer i ursprunglig form.
Component: TPdfView  ·  Unit: PDFium
Enables or disables the hint balloon shown when the mouse hovers over the PDF viewer.

Syntax

property ShowHint: Boolean; // published, inherited from TControl

Description

ShowHint controls whether the framework displays the tooltip described by Hint when the mouse rests over the viewer. Together with ParentShowHint (also published) it forms the standard VCL/LCL hint pipeline: when ParentShowHint is True, the value inherits from the parent form/panel; when it is False, the local ShowHint wins.

In a PDF reader the hint is most often used to communicate dynamic state: showing the page label under the cursor (computed from OnMouseMove + DeviceToPage), the URL of a web link under the cursor, or the keyboard shortcuts for the active toolbar. The OnShowHint event of the host form can rewrite the hint text just before display.

Disabling hints is occasionally useful when the viewer is the focal element of a kiosk-style application where pop-ups would distract users. The property only suppresses the balloon — the Hint string remains accessible via code.

Remarks

Example

// Show the page label under the cursor as a tooltip
procedure TForm1.FormCreate(Sender: TObject);
begin
  PdfView1.ShowHint := True;
  PdfView1.OnMouseMove := PdfView1MouseMove;
end;

procedure TForm1.PdfView1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
var PageNo: Integer;
begin
  if PdfView1.PointToPage(Point(X, Y), PageNo) then
    PdfView1.Hint := 'Page ' + IntToStr(PageNo) + ' / ' +
      IntToStr(PdfView1.Pdf.PageCount);
end;

See Also

OnMouseMove, Visible, Enabled, DeviceToPage