请问如何去掉WEBBROWSER的3D边框?(100)

北狼

Unregistered / Unconfirmed
GUEST, unregistred user!
在网上看了很多代码,都无效,找到这么一条,请问如何使用?function TSimpleWebBrowser.GetHostInfo(var pInfo: TDOCHOSTUIINFO): HRESULT;begin //传递给MSHTML用于描述浏览器的样式等 pInfo.cbSize := SizeOf(pInfo); pInfo.dwFlags := 0; if not ShowScrollBar then //不显示浏览器的滚动条 pInfo.dwFlags := pInfo.dwFlags or DOCHOSTUIFLAG_SCROLL_NO; if FlatScrollBars then //平面类型的滚动条显示 pInfo.dwFlags := pInfo.dwFlags or DOCHOSTUIFLAG_FLAT_SCROLLBAR; if not Border3DStyle then //不显示3D边框 pInfo.dwFlags := pInfo.dwFlags or DOCHOSTUIFLAG_NO3DBORDER; pInfo.dwFlags := Pinfo.dwFlags or DOCHOSTUIFLAG_ENABLE_ACTIVEX_INACTIVATE_MODE; result := S_OK; //覆盖系统本身的处理end;我的HTML文件为:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <base target=_blank><style type="text/css"><!--body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #e5e5e5; line-height:20px; margin: 0px;}A:link {text-decoration:none; color:#2e577f;}A:visited {text-decoration:none; color:#2e577f;}A:active {text-decoration:none; color:#2e577f;}A:hover {text-decoration:underline; color:#3daf23;}body,td,th { font-family: Arial, Helvetica, sans-serif;}--></style></head><body scroll=no> <table width="100%" height="17" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <span id='1' style='display:none;'><a href="http://www.09zenggao.cn/?id=yszx10" bgcolor="white">哈哈哈</a></span> </td> </tr> </table><script type="text/javascript">var min_temp=1;var max_temp=10;var temp=1;function right(){ if (temp<max_temp){ temp++; }else{ //if (ss) clearInterval(ss); temp=1; } for(i=1;i<=max_temp;i++) { document.getElementById(i).style.display = "none"; } document.getElementById(temp).style.display = "block";}ss=setInterval(right,4500); </script></body></html>
 
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);begin if WebBrowser1.Document <> nil then begin // Some Setting //WebBrowser1.OleObject.Document.body.style.margin := '0'; WebBrowser1.OleObject.Document.Body.Style.BorderWidth := 0; end;end;
 
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);begin if WebBrowser1.Document <> nil then begin // Some Setting WebBrowser1.OleObject.Document.body.style.margin := '0'; WebBrowser1.OleObject.Document.Body.Style.BorderWidth := 0; end;end;procedure TForm1.FormCreate(Sender: TObject);begin webbrowser1.Navigate('www.163.com');end;还是不行,还是有边框的哦
 
估计你是不要显示那个滚动条
 
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);beginif WebBrowser1.Document <> nil then begin // Some Setting WebBrowser1.OleObject.Document.Body.Scroll := 'no'; WebBrowser1.OleObject.Document.body.style.margin := '0'; WebBrowser1.OleObject.Document.Body.Style.BorderWidth := 0; end;end;
 
顶部