delphi动态 WebBrowser 释放问题.rar
delphi动态 WebBrowser 释放问题 var web:TwebBrowser; procedure TForm1.Button1Click(Sender: TObject); begin web:=TWebBrowser.Create(Self); web.ParentWindow:=Self.Handle; web.SetBounds(100,100,100,100); web.OnDocumentComplete:=WebBrowser1DocumentComplete; web.Navigate('http://www.3yeah.com/'); end; procedure TForm1.Button2Click(Sender: TObject); begin // web.Destroy; web.Free ; end; procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); begin if(web.Location URL='http://www.qq.com/') then begin // web.OnDocumentComplete:=nil; web.Free; end; end;
用户评论
不错的资料!
有点简单,适合初学者学习一下吧,