一個動態創建Webbrowser並給定OnDocumentComplete事件的簡單例子
---------------聲明是這樣子的(事件不同就不同)-----------------------
private
{ Private declarations }
public
{ Public declarations }
procedure proDocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
end;
----------------下面是事件執行與動態創建一個WEB-----------------------
procedure TForm1.proDocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
form1.Caption:=web.LocationName;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
web:=twebbrowser.Create(self);
TWinControl(Web).Parent := form1;
web.Visible:=true;
web.Width:=500;
web.Height:=200;
web.Left:=20;
web.Top:=60;
web.Tag:=0;
web.show;
web.Navigate('httP://www.baidu.com');
web.OnDocumentComplete := proDocumentComplete;
end;
--------------------------下麵是我的問題-------------------------------
我的目的是:動態創建多個WEB,各自有相應的OnDocumentComplete事件.
但是不知道為什麼只要用到數組創建多個就會在關閉程序時出錯.找了一個下午的資料也沒有找
解決方案..