How to remove scrollbars on WebBrowser in WPF Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Disable WPF WebBrowser scrollbarHide scrollbar in webbrowserHow do I calculate someone's age in C#?What is the correct way to create a single-instance WPF application?How do I use WPF bindings with RelativeSource?How do I enumerate an enum in C#?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?What is a NullReferenceException, and how do I fix it?hide webBrowser scrollbar wpfGrid Container resize with height and width specified - C# WPF AnchoringEmbbed a PDF into a WPF WebBrowser and then print it

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

How to tell that you are a giant?

The code below, is it ill-formed NDR or is it well formed?

Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?

What is the topology associated with the algebras for the ultrafilter monad?

Did Krishna say in Bhagavad Gita "I am in every living being"

Do wooden building fires get hotter than 600°C?

How to write the following sign?

Performance gap between vector<bool> and array

Can the Great Weapon Master feat's damage bonus and accuracy penalty apply to attacks from the Spiritual Weapon spell?

Is CEO the "profession" with the most psychopaths?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

As a beginner, should I get a Squier Strat with a SSS config or a HSS?

What is the difference between globalisation and imperialism?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

Is there any word for a place full of confusion?

Can anything be seen from the center of the Boötes void? How dark would it be?

How to compare two different files line by line in unix?

How to write this math term? with cases it isn't working

Did Deadpool rescue all of the X-Force?

Chinese Seal on silk painting - what does it mean?

What initially awakened the Balrog?



How to remove scrollbars on WebBrowser in WPF



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Disable WPF WebBrowser scrollbarHide scrollbar in webbrowserHow do I calculate someone's age in C#?What is the correct way to create a single-instance WPF application?How do I use WPF bindings with RelativeSource?How do I enumerate an enum in C#?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?What is a NullReferenceException, and how do I fix it?hide webBrowser scrollbar wpfGrid Container resize with height and width specified - C# WPF AnchoringEmbbed a PDF into a WPF WebBrowser and then print it



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I am using WebBrowser control in my application like:



<WebBrowser x:Name="wcPlayback" Visibility="Visible" LoadCompleted="wcPlayback_LoadComplete" Margin="0,-4,0,0" Width="960px" Height="619px" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"></WebBrowser>


I did many tries to remove scrollbar but failed.



Please help me.










share|improve this question






















  • Check this answer: stackoverflow.com/questions/12930297/…

    – Nicholas W
    Jun 13 '13 at 12:22

















2















I am using WebBrowser control in my application like:



<WebBrowser x:Name="wcPlayback" Visibility="Visible" LoadCompleted="wcPlayback_LoadComplete" Margin="0,-4,0,0" Width="960px" Height="619px" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"></WebBrowser>


I did many tries to remove scrollbar but failed.



Please help me.










share|improve this question






















  • Check this answer: stackoverflow.com/questions/12930297/…

    – Nicholas W
    Jun 13 '13 at 12:22













2












2








2


1






I am using WebBrowser control in my application like:



<WebBrowser x:Name="wcPlayback" Visibility="Visible" LoadCompleted="wcPlayback_LoadComplete" Margin="0,-4,0,0" Width="960px" Height="619px" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"></WebBrowser>


I did many tries to remove scrollbar but failed.



Please help me.










share|improve this question














I am using WebBrowser control in my application like:



<WebBrowser x:Name="wcPlayback" Visibility="Visible" LoadCompleted="wcPlayback_LoadComplete" Margin="0,-4,0,0" Width="960px" Height="619px" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"></WebBrowser>


I did many tries to remove scrollbar but failed.



Please help me.







.net wpf c#-4.0






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 13 '13 at 12:19









azharmalik3azharmalik3

135516




135516












  • Check this answer: stackoverflow.com/questions/12930297/…

    – Nicholas W
    Jun 13 '13 at 12:22

















  • Check this answer: stackoverflow.com/questions/12930297/…

    – Nicholas W
    Jun 13 '13 at 12:22
















Check this answer: stackoverflow.com/questions/12930297/…

– Nicholas W
Jun 13 '13 at 12:22





Check this answer: stackoverflow.com/questions/12930297/…

– Nicholas W
Jun 13 '13 at 12:22












4 Answers
4






active

oldest

votes


















8














In case you can modify the web page you want to load, just modify the body tag as below:



<body scroll="no">


It worked for me.



Follow this link for more details:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/a64e2247-c726-473e-bed2-12a2b4454ede/how-to-show-hide-scrollbars-in-new-35-sp1-beta-wpf-webbrowser-control?forum=wpf






share|improve this answer

























  • Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

    – lelimacon
    Sep 14 '16 at 13:07



















7














I used this code and worked for me:



<WebBrowser LoadCompleted="wb_LoadCompleted"></WebBrowser> 

void wb_LoadCompleted(object sender, NavigationEventArgs e)

string script = "document.body.style.overflow ='hidden'";
WebBrowser wb = (WebBrowser)sender;
wb.InvokeScript("execScript", new Object[] script, "JavaScript" );



[edit]



The point is, you need to set overflow: hidden; in your page css. The code above is doing it.






share|improve this answer























  • Unknown InvokeScript function.

    – azharmalik3
    Jun 13 '13 at 13:00











  • So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

    – Nickon
    Jun 13 '13 at 13:07












  • You can try to modify the code as they described in their MSDN reference's example;)

    – Nickon
    Jun 13 '13 at 13:11











  • webbrowser control does not allowed me to hide its own scrollbar in wpf

    – azharmalik3
    Jun 13 '13 at 13:21











  • I don't know, that code works for me. I have just checked it. No scrollbars at all:/

    – Nickon
    Jun 13 '13 at 14:15


















2














In my case, script from Nickon's answer abow, does not work:



string script = "document.body.style.overflow ='hidden'" // Does not work;


but this works:



string script = "document.documentElement.style.overflow ='hidden'" //Work for me;





share|improve this answer






























    0














    I used this to change the body string directly:



    wcPlayback.Document.Body.scroll = "no";





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17086927%2fhow-to-remove-scrollbars-on-webbrowser-in-wpf%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      8














      In case you can modify the web page you want to load, just modify the body tag as below:



      <body scroll="no">


      It worked for me.



      Follow this link for more details:
      https://social.msdn.microsoft.com/Forums/vstudio/en-US/a64e2247-c726-473e-bed2-12a2b4454ede/how-to-show-hide-scrollbars-in-new-35-sp1-beta-wpf-webbrowser-control?forum=wpf






      share|improve this answer

























      • Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

        – lelimacon
        Sep 14 '16 at 13:07
















      8














      In case you can modify the web page you want to load, just modify the body tag as below:



      <body scroll="no">


      It worked for me.



      Follow this link for more details:
      https://social.msdn.microsoft.com/Forums/vstudio/en-US/a64e2247-c726-473e-bed2-12a2b4454ede/how-to-show-hide-scrollbars-in-new-35-sp1-beta-wpf-webbrowser-control?forum=wpf






      share|improve this answer

























      • Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

        – lelimacon
        Sep 14 '16 at 13:07














      8












      8








      8







      In case you can modify the web page you want to load, just modify the body tag as below:



      <body scroll="no">


      It worked for me.



      Follow this link for more details:
      https://social.msdn.microsoft.com/Forums/vstudio/en-US/a64e2247-c726-473e-bed2-12a2b4454ede/how-to-show-hide-scrollbars-in-new-35-sp1-beta-wpf-webbrowser-control?forum=wpf






      share|improve this answer















      In case you can modify the web page you want to load, just modify the body tag as below:



      <body scroll="no">


      It worked for me.



      Follow this link for more details:
      https://social.msdn.microsoft.com/Forums/vstudio/en-US/a64e2247-c726-473e-bed2-12a2b4454ede/how-to-show-hide-scrollbars-in-new-35-sp1-beta-wpf-webbrowser-control?forum=wpf







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 19 '15 at 3:17

























      answered Jan 9 '15 at 3:48









      Khoa NguyenKhoa Nguyen

      9113




      9113












      • Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

        – lelimacon
        Sep 14 '16 at 13:07


















      • Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

        – lelimacon
        Sep 14 '16 at 13:07

















      Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

      – lelimacon
      Sep 14 '16 at 13:07






      Or even better: scroll="auto", the browser will then only show the scrollbar if needed.

      – lelimacon
      Sep 14 '16 at 13:07














      7














      I used this code and worked for me:



      <WebBrowser LoadCompleted="wb_LoadCompleted"></WebBrowser> 

      void wb_LoadCompleted(object sender, NavigationEventArgs e)

      string script = "document.body.style.overflow ='hidden'";
      WebBrowser wb = (WebBrowser)sender;
      wb.InvokeScript("execScript", new Object[] script, "JavaScript" );



      [edit]



      The point is, you need to set overflow: hidden; in your page css. The code above is doing it.






      share|improve this answer























      • Unknown InvokeScript function.

        – azharmalik3
        Jun 13 '13 at 13:00











      • So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

        – Nickon
        Jun 13 '13 at 13:07












      • You can try to modify the code as they described in their MSDN reference's example;)

        – Nickon
        Jun 13 '13 at 13:11











      • webbrowser control does not allowed me to hide its own scrollbar in wpf

        – azharmalik3
        Jun 13 '13 at 13:21











      • I don't know, that code works for me. I have just checked it. No scrollbars at all:/

        – Nickon
        Jun 13 '13 at 14:15















      7














      I used this code and worked for me:



      <WebBrowser LoadCompleted="wb_LoadCompleted"></WebBrowser> 

      void wb_LoadCompleted(object sender, NavigationEventArgs e)

      string script = "document.body.style.overflow ='hidden'";
      WebBrowser wb = (WebBrowser)sender;
      wb.InvokeScript("execScript", new Object[] script, "JavaScript" );



      [edit]



      The point is, you need to set overflow: hidden; in your page css. The code above is doing it.






      share|improve this answer























      • Unknown InvokeScript function.

        – azharmalik3
        Jun 13 '13 at 13:00











      • So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

        – Nickon
        Jun 13 '13 at 13:07












      • You can try to modify the code as they described in their MSDN reference's example;)

        – Nickon
        Jun 13 '13 at 13:11











      • webbrowser control does not allowed me to hide its own scrollbar in wpf

        – azharmalik3
        Jun 13 '13 at 13:21











      • I don't know, that code works for me. I have just checked it. No scrollbars at all:/

        – Nickon
        Jun 13 '13 at 14:15













      7












      7








      7







      I used this code and worked for me:



      <WebBrowser LoadCompleted="wb_LoadCompleted"></WebBrowser> 

      void wb_LoadCompleted(object sender, NavigationEventArgs e)

      string script = "document.body.style.overflow ='hidden'";
      WebBrowser wb = (WebBrowser)sender;
      wb.InvokeScript("execScript", new Object[] script, "JavaScript" );



      [edit]



      The point is, you need to set overflow: hidden; in your page css. The code above is doing it.






      share|improve this answer













      I used this code and worked for me:



      <WebBrowser LoadCompleted="wb_LoadCompleted"></WebBrowser> 

      void wb_LoadCompleted(object sender, NavigationEventArgs e)

      string script = "document.body.style.overflow ='hidden'";
      WebBrowser wb = (WebBrowser)sender;
      wb.InvokeScript("execScript", new Object[] script, "JavaScript" );



      [edit]



      The point is, you need to set overflow: hidden; in your page css. The code above is doing it.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jun 13 '13 at 12:46









      NickonNickon

      3,62094293




      3,62094293












      • Unknown InvokeScript function.

        – azharmalik3
        Jun 13 '13 at 13:00











      • So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

        – Nickon
        Jun 13 '13 at 13:07












      • You can try to modify the code as they described in their MSDN reference's example;)

        – Nickon
        Jun 13 '13 at 13:11











      • webbrowser control does not allowed me to hide its own scrollbar in wpf

        – azharmalik3
        Jun 13 '13 at 13:21











      • I don't know, that code works for me. I have just checked it. No scrollbars at all:/

        – Nickon
        Jun 13 '13 at 14:15

















      • Unknown InvokeScript function.

        – azharmalik3
        Jun 13 '13 at 13:00











      • So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

        – Nickon
        Jun 13 '13 at 13:07












      • You can try to modify the code as they described in their MSDN reference's example;)

        – Nickon
        Jun 13 '13 at 13:11











      • webbrowser control does not allowed me to hide its own scrollbar in wpf

        – azharmalik3
        Jun 13 '13 at 13:21











      • I don't know, that code works for me. I have just checked it. No scrollbars at all:/

        – Nickon
        Jun 13 '13 at 14:15
















      Unknown InvokeScript function.

      – azharmalik3
      Jun 13 '13 at 13:00





      Unknown InvokeScript function.

      – azharmalik3
      Jun 13 '13 at 13:00













      So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

      – Nickon
      Jun 13 '13 at 13:07






      So, it looks like a bad reference for WebBrowser class. Check this: msdn.microsoft.com/en-us/library/cc452443.aspx

      – Nickon
      Jun 13 '13 at 13:07














      You can try to modify the code as they described in their MSDN reference's example;)

      – Nickon
      Jun 13 '13 at 13:11





      You can try to modify the code as they described in their MSDN reference's example;)

      – Nickon
      Jun 13 '13 at 13:11













      webbrowser control does not allowed me to hide its own scrollbar in wpf

      – azharmalik3
      Jun 13 '13 at 13:21





      webbrowser control does not allowed me to hide its own scrollbar in wpf

      – azharmalik3
      Jun 13 '13 at 13:21













      I don't know, that code works for me. I have just checked it. No scrollbars at all:/

      – Nickon
      Jun 13 '13 at 14:15





      I don't know, that code works for me. I have just checked it. No scrollbars at all:/

      – Nickon
      Jun 13 '13 at 14:15











      2














      In my case, script from Nickon's answer abow, does not work:



      string script = "document.body.style.overflow ='hidden'" // Does not work;


      but this works:



      string script = "document.documentElement.style.overflow ='hidden'" //Work for me;





      share|improve this answer



























        2














        In my case, script from Nickon's answer abow, does not work:



        string script = "document.body.style.overflow ='hidden'" // Does not work;


        but this works:



        string script = "document.documentElement.style.overflow ='hidden'" //Work for me;





        share|improve this answer

























          2












          2








          2







          In my case, script from Nickon's answer abow, does not work:



          string script = "document.body.style.overflow ='hidden'" // Does not work;


          but this works:



          string script = "document.documentElement.style.overflow ='hidden'" //Work for me;





          share|improve this answer













          In my case, script from Nickon's answer abow, does not work:



          string script = "document.body.style.overflow ='hidden'" // Does not work;


          but this works:



          string script = "document.documentElement.style.overflow ='hidden'" //Work for me;






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 1 '15 at 16:10









          LeffBALeffBA

          214




          214





















              0














              I used this to change the body string directly:



              wcPlayback.Document.Body.scroll = "no";





              share|improve this answer



























                0














                I used this to change the body string directly:



                wcPlayback.Document.Body.scroll = "no";





                share|improve this answer

























                  0












                  0








                  0







                  I used this to change the body string directly:



                  wcPlayback.Document.Body.scroll = "no";





                  share|improve this answer













                  I used this to change the body string directly:



                  wcPlayback.Document.Body.scroll = "no";






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 8 at 20:22









                  HackSlashHackSlash

                  9221517




                  9221517



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17086927%2fhow-to-remove-scrollbars-on-webbrowser-in-wpf%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                      Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                      Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved