An empty scroll bar and sometimes a border appear if the following conditions are true: 
You display a frameset in an application that hosts the WebBrowser control. -and-
You navigate to a frame in the frameset elsewhere in the BeforeNavigate or the BeforeNavigate2 event handler.
These items should not appear in the frameTo work around the problem with the scroll bar, use one of the following methods: 
In the HTML source for the frame page, manually add the "auto" or the "no" value to the scroll attribute in the <body> tag.
Add the scroll attribute dynamically through Dynamic HTML (DHTML).
Delay the navigation by posting a user-defined message and by performing the navigation in the user-defined message handler.
To work around the problem with the border, use one of the following methods: 
Post a user-defined message, and then perform the navigation in the user-defined message handler.
Implement the IDocHostUIHandler interface, and then return DOCHOSTUIFLAG_NO3DBORDER in the GetHostInfo method.
谢谢各位,我终于找到了!

解决方案 »

  1.   

    private   void   axWebBrowser1_DownloadComplete(object   sender,   System.EventArgs   e) 

    IHTMLDocument2   HTMLDocument   =(IHTMLDocument2)   axWebBrowser1.Document; 
    HTMLDocument.body.style.overflow   =   "hidden "; } 
      

  2.   

    如何隐藏WebBrowser控件的边框与滚动条(转)  当我们在程序窗体中要显示网页的内容,我们当然首选是WebBrowser控件,可是有时候因为美观的需要,我们要去掉WebBrowser的边框与滚动条,解决的方法是使用CSS样式表。如果我们可以修改要显示的网页代码,则可以直接在网页的头(head)部分中加入<style>BODY{ border:0px; overflow:hidden; }</style>即可。如果网页代码不能修改,我们则可以使用代码动态修改样式而达到目的,代码如下:Dim WB As WebBrowser
    Set WB = Me.WebBrowser1.Object
    WB.Document.body.Style.border = "0px" '隐藏边框
    WB.Document.body.Style.overflow = "hidden" '隐藏滚动条
    WB.Document.body.Style.margin = "0px" '修改网页边距为0
    ............事实上我可以只要参照DOM对应的样式控件语法修改好了