也在 TWebBrowser 中打开新页面
我创建了一个带有 twebBrowser 的应用程序。问题是,当我单击某个链接(例如 gmail)时,它会在我的默认浏览器(即 IE)的新窗口中打开。我如何让它像 firefox 或 chrome 等一样工作,在它们的窗口中打开单击的链接。该 URL 应在 TWebBrowser 的窗口中打开。我必须在运行时创建一个新的表单并在运行时使用 TWebBrowser 吗?不需要这样的代码,想法就可以了,
提前致谢。
PS 我的组织阻止 Gmail、Facebook 等,但是通过我的 TWebBrowser,我可以打开它们。我的 QA 人员可以在他们的日志中看到这一点吗?我的猜测是否定的,因为那时他们会阻止它。您对此有何评论
I have created an app with a twebBrowser in it. Problem is when i click on some link, in say gmail, it opens in a new window of my default browser( which is IE). how do i make it work like firefox or chrome etc. which opens the clicked links in their windows. The url's should open in the TWebBrowser's window. Must i create a new Form at runtime with TWebBrowser in it at runtime for that? Code not needed as such, ideas will do
Thanks in Advance.
P.S. My org blocks Gmail, Facebook etc. , However through my TWebBrowser, i can open them. Can my QA ppl see that in their log? My guess will be no, since then they would block it. What is your comment on this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TWebBrowser
有一个OnNewWindow2
事件。假设持有TWebBrowser
的表单名为Form1
并且 Web 控件本身名为WebBrowser1
,请编写如下处理程序:这将创建一个新窗口,当“单击”应该打开一个新窗口时,带有一个新的
TWebBrowser
。TWebBrowser
has anOnNewWindow2
event. Assuming the form holding theTWebBrowser
is namedForm1
and the web-control itself is namedWebBrowser1
, write a handler like this:This will create a new window, with a new
TWebBrowser
when the "click" is supposed to lead to a new window.