Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:06:23+00:00 2026-05-26T09:06:23+00:00

Unlike say a RichTextBox control which has a enum ScrollBars property, the WebBrowser control

  • 0

Unlike say a RichTextBox control which has a enum ScrollBars property, the WebBrowser control just has a boolean property “ScrollBarsEnabled”.

Setting it ScrollBarsEnabled = True, the vertical scrollbar shows all the time (even when not needed). The horizontal scrollbar behaves as one would expect and only appears when it’s needed.

Setting ScrollBarsEnabled = False;
neither scrollbar ever shows up.

Sample Code:

 public Form1()
    {
        InitializeComponent();

        WebBrowser webBrowser1 = new WebBrowser();

        webBrowser1.Size = new Size(this.Width - 50, this.Height - 50);
        webBrowser1.Location = new Point(25, 10);
        webBrowser1.AllowWebBrowserDrop = false;
        webBrowser1.ScrollBarsEnabled = true;

        string preText = "<html><head></head><body><div>";
        string bodyText = "Hello World";
        string postText = "</body></div></html>";
        webBrowser1.DocumentText = preText + bodyText + postText;


        this.Controls.Add(webBrowser1);
    }

Output of code sample, notice the vertical scrollbar

Other things tried:

  • Tried in .Net 4.0, & .Net 2.0.
  • Tried with computers that had IE6 and IE8
  • Tried loading an external page (using .Navigate(“someurl”) instead of setting DocumentText.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:06:23+00:00Added an answer on May 26, 2026 at 9:06 am

    Scroll bars can be controlled in most browsers via CSS, though useful only if you have control of the content:

    html, body
    {
        overflow: auto;
    }
    

    Of course, whether the WebBrowser control honours this is yet to be seen.

    See http://www.w3schools.com/cssref/pr_pos_overflow.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

s3c44b0x does not support flash breakpoint(unlike other processors such as lpc1758 which has on-chip
I'm using Git for version control and unlike SVN I have not come across
I just wondered why, unlike Scala, F# or Haskell, the basic .NET framework (as
How does one bind an iPhone SDK control (say a UISlider) using Interface Builder?
I'm pulling in an RSS feed from a Tumblr blog. Unlike WordPress, which gives
From ImmutableList javadocs: Unlike Collections.unmodifiableList(java.util.List), which is a view of a separate collection that
Unlike JTextArea , JTextPane has no option to turn line wrapping off. I found
Unlike GET , in which building the query is straightforward (concatenating fields into one
Unlike many of the ASP.NET documentation and examples, I'm doing a gridview list on
Unlike Java, why does C# treat methods as non-virtual functions by default? Is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.