When using a ppViewer in a form, is there a way to "force" a scroll based on a key stroke? When the user presses PgDn or PgUp nothing happens. Nor do Down or Up down anything?
Thanks.
--
Andrew Shinn High Meadow Business Solutions andys@highmeadow.com
Try adding something like the following (keys your choice) to the ppViewer form
procedure TCustPreviewForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin with ppViewer1 do begin case Key of VK_PRIOR, VK_UP: Scroll(dtUp); VK_NEXT, VK_DOWN: Scroll(dtDown); VK_HOME: begin ScrollBox.HorzScrollBar.position := 0; ScrollBox.VertScrollbar.position := 0; end; VK_END: begin with ScrollBox.HorzScrollBar do position := range; with ScrollBox.VertScrollbar do position := range; end; VK_LEFT: Scroll(dtLeft); VK_RIGHT: Scroll(dtRight); end; end;
Comments
try Ctrl + PgDn or Ctrl + PgUp!
Robbi
form
procedure TCustPreviewForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
with ppViewer1 do begin
case Key of
VK_PRIOR, VK_UP: Scroll(dtUp);
VK_NEXT, VK_DOWN: Scroll(dtDown);
VK_HOME: begin
ScrollBox.HorzScrollBar.position := 0;
ScrollBox.VertScrollbar.position := 0;
end;
VK_END: begin
with ScrollBox.HorzScrollBar do position := range;
with ScrollBox.VertScrollbar do position := range;
end;
VK_LEFT: Scroll(dtLeft);
VK_RIGHT: Scroll(dtRight);
end;
end;
end;