Is it possible to remove the bearing from a TWebBrowser?

Posted on

Question :

Is it possible to remove the vertical and horizontal bearing from a TWebBrowser ?

I searched in various places on the internet, however, I did not find a valid answer, all examples were false!

    

Answer :

Disable is a bit complicated, you do not have a property for this in the component!
But I can help you by hiding the bars …

Add these 2 lines of code in the TWebBrowser OnDocumentComplete:

WebBrowser1.OleObject.Document.Body.Style.OverflowX := 'hidden';
WebBrowser1.OleObject.Document.Body.Style.OverflowY := 'hidden';

With this, after page load the bars are hidden!

    

Leave a Reply

Your email address will not be published. Required fields are marked *