VB.NET自己做的网页浏览器
展开全部
vb.net2008, 网上找的,网页没加载完可能会出错
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.163.com")
End Sub
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
Dim urlNew
e.Cancel = True
urlNew = WebBrowser1.Document.ActiveElement.GetAttribute("href")
WebBrowser1.Navigate(urlNew)
End Sub
End Class
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.163.com")
End Sub
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
Dim urlNew
e.Cancel = True
urlNew = WebBrowser1.Document.ActiveElement.GetAttribute("href")
WebBrowser1.Navigate(urlNew)
End Sub
End Class
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub webbrowser_NewWindow2(ppDisp As Object, Cancel As Boolean)
set ppdisp=webbrowser.object
End Sub
set ppdisp=webbrowser.object
End Sub
追问
不行啊,有错误
“object”不是"System.Windows.Forms.WebBrowser"的成员。
追答
你先试试设置:工具——internet选项——常规页------更改网页在选项卡中的显示方式
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询