1

I am in need of disabling the scrollbar which appears in the application. Using the default web browser there is a option called ScrollBarsEnabled which you can set true of false allowing the scrollbar to be hidden or not while scrolling.

Sadly i dont think Gecko has this feature seeing as its not listed!

I came across a similar post which had my issue but all that does is change the css which then causes my page to become not scroll-able.

Thread: how to hide scrollbar in gecko webbrowser control in c#

Does anyone to this date, have any idea how to hide/disable that scroll bar?

William
  • 1,009
  • 15
  • 41

1 Answers1

-1

A different workaround could be to move the margin a little bit, as described here

#content browser {
 margin-right: -14px !important;
 overflow-y: scroll;
 overflow-x: hidden;
}
Bartosz
  • 4,406
  • 7
  • 41
  • 80
  • So putting that into code perspective is doing: `webBrowser1.Document.Body.Style.CssText = "//Code above here?"` Seeing as you referred `#content browser` how do i point the `CssText` to the listed? Thanks! P.S: If you are suggesting that i use that Chrome.css solution, i tried that also before but it only removes the scroll bar for the firefox browser, i still have the scroll bar appearing via inside my app. Now, if i can use CssText to the above.. That could work? But again, not sure how! – William Jul 10 '17 at 08:06
  • @irishwill200 - perhaps your problem is with the winforms/wpf scrollbar, which is not related to geckofx? Look at the properties of the host control of your browser control. – Bartosz Jul 10 '17 at 08:20
  • Im using Gecko webbrowser component which doesnt use the default one. The gecko one does not have any options or settings regarding the scrollbar like i stated in my question. – William Jul 10 '17 at 09:29
  • @irishwill200 - yes, and based on your comment, I am suggesting that perhaps the scrollbar you see is not on webbrowser, but rather on a host control. – Bartosz Jul 10 '17 at 12:10
  • Ohh I understand now, On the form itself, `Host Control` i have autoscroll set to false. Is there any other option that i may need false? – William Jul 10 '17 at 13:14
  • @irishwill200 are you using wpf or winforms? A screenshot or some code (XAML) sample would help. – Bartosz Jul 10 '17 at 14:42
  • Anybody care to explain the downvote? @irishwill200 - FYI, I stopped observing your question because you provide too little information and I have no time to ask questions. – Bartosz Jul 17 '17 at 14:48