gpt4 book ai didi

Delphi:WebBrowser 的 OnDownloadComplete 一次发生多次

转载 作者:行者123 更新时间:2023-12-01 19:47:20 25 4
gpt4 key购买 nike

例如在此代码中:

procedure TForm1.WebBrowser1DownloadComplete(Sender: TObject);
begin
ShowMessage('Download Completed');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate('http://www.google.com/');
end;

“WebBrowser1DownloadComplete”消息在 1 Navigate 上出现多次。
这很烦人,并且使该事件几乎毫无用处。

为什么会发生这种情况?如何避免这种情况?
谢谢

最佳答案

也许 OnNavigationComplete2 事件处理程序更适合您的应用程序。

Occurs immediately after the Web browser successfully navigates to a new location.

Write an OnNavigateComplete2 event handler to take specific action when the Web browser successfully navigates to a new resource. The event can occur before the document is fully downloaded, but when it occurs at least part of the document must be received and a viewer for the document created.

关于Delphi:WebBrowser 的 OnDownloadComplete 一次发生多次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11594160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com