在新窗口中打开导航... [英] open in new windows navigation...
本文介绍了在新窗口中打开导航...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在在新窗口中打开"选项被单击时,会打开新窗口,但
无法浏览链接.
代码------
-------------------
in web browser when open in new window option is clicked new window is opened but
does not navigate the link.
code------
-------------------
Private Sub WebBrowser1_NewWindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
Dim myElement As HtmlElement = WebBrowser1.Document.ActiveElement
Dim target As String = myElement.GetAttribute("href")
Dim newInstance As New Form1
newInstance.Show()
newInstance.WebBrowser1.Navigate(target)
e.Cancel = True
End Sub
-------------------------------------------------- --------------------------
----------------------------------------------------------------------------
推荐答案
我不知道"看不到您的代码有任何问题.检查目标"变量是否具有正确的链接.
I don''t see any problem with your code. Check if the ''target'' variable has the right link.
目标"不起作用..当我用自己的网络浏览器的新窗口打开时,它变为空白或其他内容错误.我需要从网络文档中获取特定的网址.不是"Href" ...
StatusText显示,这是我正在谈论的内容,但是当我将其添加到WebBrowser1.Navigate时它不起作用,因为mousemove会更改statustext ...
谢谢
贾里德(Jared)
"target" doesnt work.. when i open with a new window of my own web browser, it goes blank or something error. I need to get a specific url from the web document. Not "Href"...
StatusText showed, that''s what im talking about but it doesnt work when i added this to WebBrowser1.Navigate because mousemove will change the statustext...
Thanks
Jared
这篇关于在新窗口中打开导航...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文