开发者

Keep Popup Window in WebBrowser control instead of a new window

开发者 https://www.devze.com 2023-01-24 09:18 出处:网络
W开发者_运维知识库hen using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window?

W开发者_运维知识库hen using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window?

I can't figure out how to get the popup to appear in the same browser window. please help me :)

PS : The language I use is VB


If you have multiple tabs with WebBrowsers, use this under the "New Window" Event:

((WebBrowser)TabControl1.SelectedTab.Controls[0]).Navigate(((WebBrowser)
TabControl1.SelectedTab.Controls[0]).StatusText)

'next input <cancel[IE]>
e.Cancel = True

If just a plain browser put this under the New Window Event:

webBrowser1.Navigate(webBrowser1.StatusText)
e.Cancel = True
0

精彩评论

暂无评论...
验证码 换一张
取 消