如何让文本框显示 Web 浏览器当前所在网页的 URL?
How can I make the textbox say the URL of the webpage that the web browser is currently on?
我希望 TextBox
显示网络浏览器当前所在网页的 URL。下面显示的代码似乎没有解决我的问题。
当我通过调用 WebBrowser1.GoBack()
导航到上一页时,TextBox
没有改变
真诚感谢您的帮助!
我试过这个:
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = WebBrowser1.Url.ToString()
End Sub
使用 WebBrowser 的 Navigated 事件获取它的当前 URL。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub WebBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
TextBox1.Text = e.Url.ToString
End Sub
我希望 TextBox
显示网络浏览器当前所在网页的 URL。下面显示的代码似乎没有解决我的问题。
当我通过调用 WebBrowser1.GoBack()
TextBox
没有改变
真诚感谢您的帮助!
我试过这个:
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = WebBrowser1.Url.ToString()
End Sub
使用 WebBrowser 的 Navigated 事件获取它的当前 URL。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub WebBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
TextBox1.Text = e.Url.ToString
End Sub