Adjusting Scroll Speed in RadPdfViewer for WinForms
Environment
Product Version | Product | Author |
---|---|---|
2024.4.1113 | RadPdfViewer for WinForms | Dinko Krastev |
Description
Adjusting the default scroll speed of RadPdfViewer is essential when need to navigate through documents more quickly. This knowledge-base article also answers the following questions:
- How can I increase the mouse wheel scroll speed in RadPdfViewer?
- Is there a way to customize scrolling behavior in RadPdfViewer for WinForms?
- How to modify RadPdfViewer to scroll faster with the mouse wheel?
Solution
To change the scrolling speed in RadPdfViewer, create a custom RadPdfViewer
control by overriding the ProcessMouseWheel
method. This adjustment allows for a customized scrolling experience, enhancing navigation through documents.
Step 1: Create the Custom RadPdfViewer Control
First, implement the CustomPdfViewer
class by extending RadPdfViewer
. This class overrides the CreateViewerElement
method to return an instance of a custom RadPdfViewerElement
.
Step 2: Customize the RadPdfViewerElement
Next, define the CustomRadPdfViewerElement
class by extending RadPdfViewerElement
. Override the ProcessMouseWheel
method to customize the scroll behavior. In this example, the scroll amount is multiplied by 5 to increase the scroll speed. Adjust this value as needed.
Step 3: Replace RadPdfViewer with the Custom Control
In the Designer.cs file of your form, replace the RadPdfViewer
control instance with the newly created CustomPdfViewer
control. This change applies the customized scrolling functionality to your application.