0

I was looking for a way to set the zoom level of my Windows Form Application in which I have navigate some urls. So I open the urls using:

webBrowser1.Navigate("url")

and I want to set the zoom level of the webBrowser1 that depends on the url I have chosen. I have seen the below link but none of them have worked :

https://social.msdn.microsoft.com/Forums/en-US/69f57099-428a-4b17-9b8e-c05ec269c480/zoom-inout-while-designing-forms-in-windows-forms-designer?forum=winformsdesigner&fbclid=IwAR3aZdGsVf4lE5Lw9E3x7grp1dYoWZIUHmhVzJmU8S2BzzwnzaV20Hv5HoE

https://weblog.west-wind.com/posts/2016/Aug/22/Detecting-and-Setting-Zoom-Level-in-the-WPF-WebBrowser-Control

Problems having content in webbrowser scale automatically in Windows Form Application

  • 1
    [Windows forms web browser control zoom level](https://stackoverflow.com/a/52255558/7444103). There are other answers on SO about this same code. Reza Aghaei's adds an explanation of what's being done that can be useful to read. Using the activated Instance of the underlying Internet Explorer object gives you a large number of options that you might want to try exploiting. See also: [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/questions/38514184/how-can-i-get-the-webbrowser-control-to-show-modern-contents?answertab=active#tab-top). Same author. – Jimi Nov 06 '18 at 08:46
  • 1
    Possible duplicate of [Windows forms web browser control zoom level](https://stackoverflow.com/questions/52217916/windows-forms-web-browser-control-zoom-level) – Jimi Nov 06 '18 at 08:52

1 Answers1

1

Please try this

webBrowser1.Document.Body.Style = "zoom:50%";

Nakul
  • 137
  • 1
  • 11