procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
beginwith TWebBrowser(Sender) do
if ReadyState >= READYSTATE_LOADED then
OleObject.Document.Body.Scroll:='no';end;procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate('www.baidu.com');
end;end.
为什么用上面的 代码,滚动条还在

解决方案 »

  1.   

    procedure TForm1.wb2DownloadComplete(Sender: TObject);
    begin
       if wb2.ReadyState=3 then wb2.OleObject.document.body.scroll:='no';
    end;
      

  2.   

    procedure TForm1.WEBDocumentComplete(ASender: TObject;
      const pDisp: IDispatch; var URL: OleVariant);
    begin
        Application.ProcessMessages;
        WEB.OleObject.Document.Body.Scroll := 'no';
        WEB.OleObject.Document.Body.style.border := 'none';
        WEB.OleObject.Document.Body.Style.margin := '0px';
    end;
      

  3.   

    if ReadyState >= READYSTATE_LOADED then
    OleObject.Document.Body.Scroll:='no';if 改成while 
    if只判断一次然后不会再进入
    如果失败自然后面一句不会执行我今天刚用的源码:
    procedure TfrmMain.GetLogo ;//都是从网上找来的,不过很好用
    begin
    tag := 0;
    WebBrowser1.Navigate('http://192.168.0.2/testweb/newlogo.jpg');
    while(tag=0) do Application.ProcessMessages;
    WebBrowser1.oleobject.Document.body.Scroll := 'no';
    WebBrowser1.OleObject.Document.Body.style.border := 'none';
    webbrowser1.OleObject.Document.Body.Style.margin := '0px';
    end;procedure TfrmMain.LoadComplete(Sender: TObject; const pDisp: IDispatch;
      var URL: OleVariant);
    begin
         tag := 1 ;
    end;