M
mycoolis2
Unregistered / Unconfirmed
GUEST, unregistred user!
动态生成的WebBrowser2如何处理事件?
Form1上有一个webbrowser1,事件
procedure TForm1.WebBrowser1TitleChange(Sender: TObject;
const Text: WideString);
begin
showmessage(text);
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
showmessage('complete');
end;
还有一个var webbrowser2:twebbrowser;
procedure TForm1.FormCreate(Sender: TObject);
var t:twebbrowserdocumentcomplete;
begin
webbrowser2:=twebbrowser.Create (self);
webbrowser2.OnDocumentComplete :=WebBrowser1DocumentComplete;
webbrowser2.OnTitleChange :=WebBrowser1TitleChange;
end;
OnTitleChange正常,而OnDocumentComplete没反应,why?
Form1上有一个webbrowser1,事件
procedure TForm1.WebBrowser1TitleChange(Sender: TObject;
const Text: WideString);
begin
showmessage(text);
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
showmessage('complete');
end;
还有一个var webbrowser2:twebbrowser;
procedure TForm1.FormCreate(Sender: TObject);
var t:twebbrowserdocumentcomplete;
begin
webbrowser2:=twebbrowser.Create (self);
webbrowser2.OnDocumentComplete :=WebBrowser1DocumentComplete;
webbrowser2.OnTitleChange :=WebBrowser1TitleChange;
end;
OnTitleChange正常,而OnDocumentComplete没反应,why?