webbrowser control scrollbar

ethicalhacker

Well-known member
Joined
Apr 22, 2007
Messages
142
Location
Delhi,India
Programming Experience
5-10
I have made a browser in vb.net and I need to change the webbrowser control's scrollbar from the boring grey brown to a color of my choice. How can I do this?
 
Moved to Windows Forms forum, VS forum is for Visual Studio (the application) related matters.

The WebBrowser doesn't have a scrollbar (or borders or anything), it only hosts the webpage document displayed. So to change webpage scrollbar you have to change the webpage. You can do this with CSS, either append to style attribute of body element or perhaps you can add a head style element.
VB.NET:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, _
                                          ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) _
Handles WebBrowser1.DocumentCompleted
    WebBrowser1.Document.Body.Style &= ";scrollbar-base-color: orange"
End Sub
 
thanks a lot for that, It worked does this syntax work for any of the windows controls? and also how do I set an Image as the scrollbar. Something to make the scrollbar more fluid and shiny or use gradient is there a way i can use an image or is there an inbuilt way to make the scrollbar as shiny as the default blue colour for the toolstrip
 
Back
Top