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.
谢谢各位,我终于找到了!
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.
谢谢各位,我终于找到了!
{
IHTMLDocument2 HTMLDocument =(IHTMLDocument2) axWebBrowser1.Document;
HTMLDocument.body.style.overflow = "hidden "; }
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对应的样式控件语法修改好了