VertScrollBar (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example demonstrates how forms are scrolled with the PgUp and PgDn keys.

Code

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
const
  PageDelta = 10;
begin
  With VertScrollbar do
    if Key = VK_NEXT then
      Position := Position + PageDelta
    else if Key = VK_PRIOR then
      Position := Position - PageDelta;
end;

Uses