|
|
Great! Thanks.
Michal
|
|
|
Code:
...
pdfViewer1.KeyDown += PdfViewer1_KeyDown;
...
private void PdfViewer1_KeyDown(object sender, KeyEventArgs e)
{
int pageStep = pdfViewer1.AutoScrollMinSize.Height / pdfViewer1.Document.Pages.Count;
int lineStep = pageStep / 30;
var asp = pdfViewer1.AutoScrollPosition;
switch (e.KeyCode)
{
case Keys.Down:
pdfViewer1.AutoScrollPosition = new Point(asp.X, -asp.Y + lineStep);
break;
case Keys.Up:
pdfViewer1.AutoScrollPosition = new Point(asp.X, -asp.Y - lineStep);
break;
case Keys.PageDown:
pdfViewer1.AutoScrollPosition = new Point(asp.X, -asp.Y + pageStep);
break;
case Keys.PageUp:
pdfViewer1.AutoScrollPosition = new Point(asp.X, -asp.Y - pageStep);
break;
}
}
|
|
|
WinForms.
Michal
|
|
|
Winfroms or WPF?
|
|
|
Is it possible to scroll document shown id pdfViewer control using arrow keys (up, down)? It can be done using mouse wheel, but how to achieve this using keyboard arrows keys?
Michal
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close