|
-
Sep 20th, 2010, 05:16 PM
#1
Thread Starter
New Member
URL bar problems
Problem: i made a basic web-browser and i got it all to work except the URL bar... if i type something in and hit GO it works... but i want it to automatically tell me the URL of the website i'm on...
the code i have tried was...
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = (WebBrowser1.Url.ToString)
End Sub
solution:
Private Sub Navigate(ByVal address As String)
If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("http://") And _
Not address.StartsWith("https://") Then
address = "http://" & address
End If
Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub
Private Sub webBrowser1_Navigated(ByVal sender As Object, _
ByVal e As WebBrowserNavigatedEventArgs) _
Handles WebBrowser1.Navigated
TextBox1.Text = WebBrowser1.Url.ToString()
End Sub
 Originally Posted by weirddemon
That's not how this works. What if you were searching for a resolution to an issue you had, to find that the OP just deleted his question and didn't post the answer?
Frustrated, to say the least.
This website, like others, is meant to help people. If you don't share your solution, how can others benefit from that knowledge?
Last edited by axleman1011; Sep 21st, 2010 at 05:46 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|