本文整理汇总了VB.NET中System.Windows.Forms.WebBrowserNavigatingEventHandler代理的典型用法代码示例。如果您正苦于以下问题:VB.NET WebBrowserNavigatingEventHandler代理的具体用法?VB.NET WebBrowserNavigatingEventHandler怎么用?VB.NET WebBrowserNavigatingEventHandler使用的例子?那么恭喜您, 这里精选的代理代码示例或许可以为您提供帮助。
在下文中一共展示了WebBrowserNavigatingEventHandler代理的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MsgBox
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles Me.Load
webBrowser1.DocumentText = _
"<html><body>Please enter your name:<br/>" & _
"<input type='text' name='userName'/><br/>" & _
"<a href='http://www.microsoft.com'>continue</a>" & _
"</body></html>"
End Sub
Private Sub webBrowser1_Navigating( _
ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs) _
Handles webBrowser1.Navigating
Dim document As System.Windows.Forms.HtmlDocument = _
webBrowser1.Document
If document IsNot Nothing And _
document.All("userName") IsNot Nothing And _
String.IsNullOrEmpty( _
document.All("userName").GetAttribute("value")) Then
e.Cancel = True
MsgBox("You must enter your name before you can navigate to " & _
e.Url.ToString())
End If
End Sub