This code sample helps to override MouseWheel event. The default behavior of the the mouse wheel is to scroll. To override this default behavior, you must introduce a new class that inherits from StandardPagesViewer and override the OnMouseWheel method like this: following code shows how to override this default our.
public class MyPagesViewer : TallComponents.Interaction.WinForms.Controls.StandardPagesViewer
{
protected override void OnMouseWheel(MouseEventArgs e)
{
// custom action such as zooming here
((HandledMouseEventArgs)e).Handled = true;
}
}
Inside the InitializeComponent of your MainForm, make sure that you instantiate this new class like this:
public class MainForm : System.Windows.Forms.Form
{
#region Windows Form Designer generated code
private void InitializeComponent()
{
...
this.pagesViewer = new TallComponents.PDF.ReaderControls.MyPagesViewer();
...
}
}
We have sent an email with a download link. Alternatively, you may want to use the NuGet package manager to install our library.
Use the NugetID and start right away, or download the package and install it handmatically