PDFium Component Docs

ShowHint property

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 is inherited from the parent form or panel; when it is False, the local ShowHint wins.

In a PDF reader the hint is 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 on the host form can rewrite the hint text just before it appears.

Disabling hints is sometimes 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 in 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