Welcome Guest Search | Active Topics | Sign In | Register

Zoom webview using CTRL +/- not working in EO Browser Options
bnymellon
Posted: Thursday, October 28, 2021 7:33:34 AM
Rank: Advanced Member
Groups: Member

Joined: 3/10/2020
Posts: 59
Hi,
We are using EO webbrowser(20.3.34.0) in our wpf application.
User try to zoom-in /Zoom-out webpage using Keyboard CTRL+ and CTRL- keys but its not working.
Able to zoom-in/zoom-out using CTRL+mouse wheel.
Please let us know whether EO browser have inbuilt functions to handle keyboard CTRL+/- events for zoom functionality.

Thanks



eo_support
Posted: Thursday, October 28, 2021 2:37:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

EO.WebBrowser does not have built-in implementation for these two shortcuts. You can implement them in your own code and set WebView.ZoomFactor property in your handler.

Thanks!
Jon
Posted: Friday, April 8, 2022 11:31:00 AM
Rank: Newbie
Groups: Member

Joined: 4/8/2022
Posts: 1
Can you post example of how to handle the CTRL+mouse wheel?
eo_support
Posted: Friday, April 8, 2022 2:29:14 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Exactly how to handle the event would depend on what platform you use. For example, if you use WPF, you can handle MouseWheel event on the Window object like this:

Code: HTML/ASPX
<Window ..... MouseWheel="Window_MouseWheel" ...>
    ....
</Window>


Inside your Window_MouseWheel event you can then do:

Code: C#
if (Keyboard.IsKeyDown(Key.LeftCtrl))
{
    if (e.Delta > 0)
        webView.ZoomFactor = webView.ZoomFactor * 1.25;
    else if (e.Delta < 0)
        webView.ZoomFactor = webView.ZoomFactor / 1.25;
}


If you use Windows.Forms, then the code would be different. However the key part is to set the WebView's ZoomFactor property.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.