Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately I don't think there's a way to do it <em>directly</em> in managed code. There is, however, a workaround if you own the content or can inject some css / script.</p> <p>In your HTML, add this css:</p> <pre class="lang-css prettyprint-override"><code>&lt;style type="text/css"&gt; body { zoom:100%; } &lt;/style&gt; </code></pre> <p>In your HTML also include a script block like this:</p> <pre class="lang-js prettyprint-override"><code>function setZoomLevel(newZoom) { document.styleSheets[0]['rules'][0].style['zoom'] = newZoom; } </code></pre> <p>In your C# code, add a helper method:</p> <pre class="lang-cs prettyprint-override"><code>private void SetZoomLevel(int level) { string slevel = string.Format("{0}%", level); webBrowser.InvokeScript("setZoomLevel", slevel); } </code></pre> <p>In your C# code you can now adjust the zoom level by calling:</p> <pre class="lang-cs prettyprint-override"><code>SetZoomLevel(200); </code></pre> <p>That's the best I could find and unfortunately it doesn't work if you can't inject a style and some script.</p> <p><strong>NOTE:</strong> Although this does zoom content in pretty much the same way as adjusting the zoom slider, the zoom slider is not affected in the desktop browser. Therefore if you call <strong>SetZoomLevel(200);</strong> above and then set the slider to 200% you would actually see 400%. This should not be an issue in WebView because there <em>is</em> no slider.</p> <p>Hope someone comes up with a better answer.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload