Docs PDFiumVCL

TabStop property

Questa voce API conserva identificatori, firme, blocchi di codice e termini PDF nella forma originale.
Component: TPdfView  ·  Unit: PDFium
Indicates whether the user can give focus to the PDF viewer by pressing the Tab key.

Syntax

property TabStop: Boolean; // published, inherited from TWinControl

Description

When TabStop is True the PDF viewer joins the form's tab cycle. Pressing Tab while another control on the form has focus eventually moves focus into the viewer, after which keyboard shortcuts such as Page Up / Page Down, the arrow keys for scrolling and the find-shortcut handler defined in OnKeyDown all become active.

Keeping the viewer focusable is important for accessibility: screen readers and keyboard-only users need to reach the document area to step through pages or trigger text selection by holding Shift with the arrow keys. The default value for a published TabStop on a TScrollingWinControl descendant is True.

Setting TabStop := False removes the viewer from the tab order; the user can still click into it to scroll with the mouse, but the keyboard cannot focus it without an explicit PdfView1.SetFocus call. This is sometimes useful when the viewer is purely decorative — for example a preview pane next to a list of search results.

Remarks

Example

// Make the viewer fully keyboard-accessible and the first tab stop
procedure TForm1.FormCreate(Sender: TObject);
begin
  PdfView1.TabStop := True;
  PdfView1.TabOrder := 0;
  PdfView1.OnKeyDown := PdfView1KeyDown;
end;

procedure TForm1.PdfView1KeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  if (Key = VK_F3) then PdfView1.FindNext
  else if (Key = Ord('C')) and (ssCtrl in Shift) then
    Clipboard.AsText := PdfView1.SelectedText;
end;

See Also

TabOrder, AllowUserTextSelection, OnKeyDown, OnKeyPress