I am working on an HTML display control for windows forms. I am using the webBrowser control as the base for my control and I need to hide the webBrowsers scroll bar, as it looks bad, will never be used, and makes the control look like a webPage which ruins the layout. Currently the scroll bar renders on the control looking all dejected and greyed out. Is there way to simply remove it all together?
There is a property:
webBrowser1.ScrollBarsEnabled = false;
Specifies whether the WebBrowser control should have scrollbars or not.
They "can" appear however if the viewed web page is larger than the current control's size (not in all cases).
This answer Allow scroll with mouse but don't show browser scrollbars? shows this method:
void webBrowser1_DocumentCompleted(object sender,
WebBrowserDocumentCompletedEventArgs e) {
webBrowser1.Document.Body.Style = "overflow:hidden";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With