Disable Zoom

Hi everybody.

How can I disable zooming with the Ctrl+Mouse?


6 Replies

YS Yamini Sri Muthunagarajan Syncfusion Team November 20, 2025 09:21 AM UTC

Hi Andrea De Luca,

Currently, we don’t have direct API support to disable zoom in the WinForms PdfViewer. We are checking for any possible workaround and will update you on November 24, 2025.

Regards,
YaminiSri M



YS Yamini Sri Muthunagarajan Syncfusion Team November 24, 2025 03:47 PM UTC

Hi Andrea De Luca,

To disable zoom using Ctrl + Mouse Wheel, we have created a sample workaround to achieve this in the code-behind. In this sample, we subscribe to the MouseWheel event, and inside the handler, we check the HandledMouseEventArgs and set Handled to true to disable zoom. We have also attached the sample for your reference. Please review it and let us know if you need any further assistance.

Regards,
YaminiSri M


Attachment: Form_Field_issue_e3c936b5.zip


AD Andrea De Luca November 24, 2025 06:01 PM UTC

Hi, thanks for your reply.

I use Visual Basic so i've translated the code in:

   If ((ModifierKeys & Keys.Control) = Keys.Control) Then

       Dim handledArgs As HandledMouseEventArgs = e

       If (handledArgs IsNot Nothing) Then

           handledArgs.Handled = True

       End If

   End If

It works but only for e.delta <0 







YS Yamini Sri Muthunagarajan Syncfusion Team November 25, 2025 10:09 AM UTC


Hi Andrea De Luca,

After further analysis, we found that ModifierKeys and Keys.Control are numeric values in VB.NET. To check if the Ctrl key is pressed, we need to use a bitwise AND operation. In VB.NET, the correct operator for bitwise AND is And, not &.

But we initially used &, which is a string concatenation operator in VB.NET. This caused the condition to fail, so the zoom was not disabled. When you replace & with And, the condition works correctly because it performs the intended bitwise comparison.

Here’s the correct code snippet:

If (ModifierKeys And Keys.Control) = Keys.Control Then
    Dim handledArgs As HandledMouseEventArgs = e
    If handledArgs IsNot Nothing Then
        handledArgs.Handled = True
    End If
End If

Please review it and let us know if you need any further assistance.

Regards,

YaminiSri M





AD Andrea De Luca November 25, 2025 10:13 AM UTC

Fantastico!!
It was my fault 😒😒
Thank You very much. 

Your assistence is superb



YS Yamini Sri Muthunagarajan Syncfusion Team November 26, 2025 05:33 AM UTC

Thanks for the update. We are glad to hear that our recommendations were helpful to you.



Regards,

YaminiSri M


Loader.
Up arrow icon