Home General

Keyboard Scrolling in Viewer

edited July 2001 in General
Hi,

Is there any way to have the keyboard scroll within the Viewer? If so,
could I be pointed in the right direction? Thanks in advance.

Jada Case

Comments

  • edited July 2001
    If you register your own previewer, you can add code something
    like:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    procedure TmyPrintPreview.FormKeyDown(Sender: TObject;
    var Key: Word; Shift: TShiftState);
    begin
    // see Win32.Hlp for information on VK_ constants.
    if (ssCtrl in Shift) then begin
    case Key of
    VK_PRIOR: ppViewer1.PriorPage;
    VK_NEXT: ppViewer1.NextPage;
    VK_HOME: ppViewer1.FirstPage;
    VK_END: ppViewer1.LastPage;
    end;
    end
    else begin
    case Key of
    VK_NEXT: ppViewer1.ScrollBox.VertScrollBar.position :=
    ppViewer1.ScrollBox.VertScrollBar.position + 450;
    VK_PRIOR: ppViewer1.ScrollBox.VertScrollBar.position :=
    ppViewer1.ScrollBox.VertScrollBar.position - 450;
    VK_DOWN: ppViewer1.ScrollBox.VertScrollBar.position :=
    ppViewer1.ScrollBox.VertScrollBar.position + 10;
    VK_UP: ppViewer1.ScrollBox.VertScrollBar.position :=
    ppViewer1.ScrollBox.VertScrollBar.position - 10;
    end;
    end;
    end; {procedure, FormKeyDown}
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    HTH
    Jon

This discussion has been closed.