title: Unable to remove the borders and scrollbars of a TWebBrowser?
body: <p>I'm trying to remove the scrollbars and border from a TWebBrowser. I've found loads of references to the following code and it works fine when used on www.google.com:</p>
  
  <pre><code>// Switch off scrollbars
  WB.OleObject.document.body.style.overflowX := 'hidden';
  WB.OleObject.document.body.style.overflowY := 'hidden';
  
  // Switch off borders
  WB.OleObject.document.body.style.borderstyle := 'none';
  </code></pre>
  
  <p>However, using a web page generated by ASP.NET, it no longer works.</p>
  
  <p>Here's the ASP.NET aspx code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;Test&lt;/title&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#333333" border="0"&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;table style="width:100%;"&gt;
          &lt;tr&gt;
              &lt;td class="style7"&gt;
                  &lt;asp:Label ID="Label2" runat="server" Font-Names="Arial" Font-Size="21pt" 
                      ForeColor="#F2F2F2" Text="Test"&gt;&lt;/asp:Label&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>...and here's the HTML generated by the ASP.NET application:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;&lt;title&gt;
      Test
  &lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="#333333" border="0"&gt;
      &lt;form method="post" action="Default.aspx" id="form1"&gt;
  &lt;div class="aspNetHidden"&gt;
  &lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODExMDE5NzY5ZGSKCPuFcF0SPBHrn5HUkzHPVjgZoCXwtqbgbPjoAyOPAQ==" /&gt;
  &lt;/div&gt;
  
      &lt;table style="width:100%;"&gt;
          &lt;tr&gt;
              &lt;td class="style7"&gt;
                  &lt;span id="Label2" style="color:#F2F2F2;font-family:Arial;font-size:21pt;"&gt;Test&lt;/span&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any idea why the scrollbars/borders are still visible?</p>