none
Problem with zooming in IE11

    Question

  • I have problem making zooming programaticaly work. The problem is when zooming programmatically it behaves differently then when zooming in with ctrl+. See simple example below. In the example when zooming in with ctrl+ the text is being wrapped but when clicking on "go" button it zooms in without wrapping so the text disappears outside the window. How can i make it zoom in the same way as with ctrl+?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>

    <script>
    function zoomIE()
    {
        var content = document.getElementById("content");
        document.body.style.zoom = "2";
        document.body.style.overflow = "auto";
        content.style.overflow = "auto";
    }    
    </script>
    </head>
    <body>
    <div id="content">
       <h2 id="pageName">Zoom</h2>
       <input name="goButton" type="button" value="go" onclick="zoomIE();" />
        <h3>Feature Title </h3>
        <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
    molestie. Sed aliquam sem ut arcu. Phasellus sollicitudin. Vestibulum
    condimentum facilisis nulla. In hac habitasse platea dictumst. Nulla nonummy.
    Cras quis libero. Cras venenatis. Aliquam posuere lobortis pede. Nullam
    fringilla urna id leo. Praesent aliquet pretium erat. Praesent non odio.
    Pellentesque a magna a mauris vulputate lacinia. Aenean viverra. Class aptent
    taciti sociosqu ad litora torquent per conubia nostra, per inceptos
    hymenaeos. Aliquam lacus. Mauris magna eros, semper a, tempor et, rutrum et,
    tortor. </p>
      </div>
     

    <br />
    </body>
    </html>


    • Edited by Skoselger Friday, February 23, 2018 2:29 PM
    Friday, February 23, 2018 2:28 PM

Answers

  • i am actually viewing html content in a winforms application with .net browser. i have found solution that works by using functionality of webbrowsers ActiveXInstance. Example

    (SHDocVw.WebBrowser) ActiveXInstance.ExecWB(SHDocVw.OLECMDID.OLECMDID_OPTICAL_ZOOM,
                                   SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
                                   currentZoom, IntPtr.Zero);

    By zooming via ActiveXInstance it wraps the text as it should.

    • Marked as answer by Skoselger Monday, February 26, 2018 9:50 AM
    Monday, February 26, 2018 9:50 AM

All replies

  • Hi Skoselger,

    In my opinion, this issue is related with browser run javascript codes.

    The IE browser will not auto wrap the words after the page has been zoomed. 

    I have also try to set the css to force the page wrap the words.

    Unfortunately, it doesn't work.

    I suggest you could create a feedback to suggest team solve this issue.

    Best Regards,

    Brando



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 26, 2018 8:54 AM
  • i am actually viewing html content in a winforms application with .net browser. i have found solution that works by using functionality of webbrowsers ActiveXInstance. Example

    (SHDocVw.WebBrowser) ActiveXInstance.ExecWB(SHDocVw.OLECMDID.OLECMDID_OPTICAL_ZOOM,
                                   SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
                                   currentZoom, IntPtr.Zero);

    By zooming via ActiveXInstance it wraps the text as it should.

    • Marked as answer by Skoselger Monday, February 26, 2018 9:50 AM
    Monday, February 26, 2018 9:50 AM