Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(Me.TextBox1.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'リロード 現在の Web ページの最新バージョンを要求する更新。
WebBrowser1.Refresh(WebBrowserRefreshOption.Completely)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'戻る
Me.WebBrowser1.GoBack()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'進む
Me.WebBrowser1.GoForward()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'HOME
Me.WebBrowser1.GoHome()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
'リンク抜き出し
Me.TextBox2.Text = "" '初期化
'@IT参照 http://www.atmarkit.co.jp/fdotnet/dotnettips/687nondispbrowser/nondispbrowser.htmlの
Public Class NonDispBrowser
などを使用します。
End Sub
Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
'URL取得
Me.TextBox1.Text = Me.WebBrowser1.Url.ToString
End Sub
End Class
|