Results 1 to 7 of 7

Thread: [RESOLVED] textbox to show current webbrowser url

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    [RESOLVED] textbox to show current webbrowser url

    Well, in vb.net 2005, how can i make is so that after the webbrowser has navigated to site, the site address is displayed in a textbox?

    Cheers!
    Last edited by Untouchab1e; Aug 6th, 2006 at 06:40 PM. Reason: resolved

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: textbox to show current webbrowser url

    Well you pass the string that you want to go to into the .Navigate method of the Webbrowser, correct? Before that line of code just update the text of a textbox with that same string...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: textbox to show current webbrowser url

    yeh, ive got that part figured out. (if I understood your reply), but lets say i go to google.com... if i write google.com in the textbox, it wont update to http://www.google.com which is the real address. Also, if i click a link, lets say http://www.google.com/somecrazylink , the textbox wont update to show that address..

    This is what im trying to accomplish

    Cheers!

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: textbox to show current webbrowser url

    Well there is a Navigating event of the Webbrowser control, you can update the text in that event (or the Navigated event, but the former allows them to see the site before it actually finishes loading). Just display the URL of the passed in argument object of the event..
    VB Code:
    1. Private Sub WebBrowser1_Navigating(.....) Handles WebBrowser1.Navigating
    2.         TextBox1.Text = e.Url.ToString
    3. End Sub
    Last edited by gigemboy; Aug 6th, 2006 at 06:26 PM.

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: textbox to show current webbrowser url

    VB Code:
    1. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    2.      WebBrowser1.Document.Url.AbsoluteUri
    3. End sub

    There you go
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: textbox to show current webbrowser url

    blast! Too late then
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    115

    Re: textbox to show current webbrowser url

    thanks for the help! Now its just a matter of that damned tabcontrol problem (see other post)

    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width