Arrow[Help]WebBrowser

Posts 16–18 of 18 · Page 2 of 2
Okay hope i'm not 100% sure I get what you mean. BUT I'm taking a guess that the user can rename a long URL to something shorter for quick access later on.

If this isn't what you mean at all I apologise, but I don't really have a clear idea of what you want to do. In this case the user can choose to create a new "quick-URL" by clicking an appropriate button. The save form would have about 2 textboxes and a button.

Say you have 2 textboxes. TextBox1 for the quick URL to a big URL and TextBox2 is the big URL in question. The button is to save

i.e say I wanted to navigate to google using your webbrowser quickly,

I would first click the button on the main form "Create New Quick-URL"

Then on the form that pops up

add to textbox1: "Google"
add to textbox2: "http://www.google.com"

Then press save.

For the save button add this code.

[php]
SaveSetting("MyApp", URLs", TextBox1.Text, TextBox2.Text)
Form1.Show 'this is assuming you hid your main form when bringing up the save form'
Me.Close()
[/php]

Then for your "Navigate" button for the webbrowser (I'm going to call your address textbox (the one you use to type regular URLs into) txtAddress.

[php]
If GetSetting("MyApp", "URLs", txtAddress.text) <> "" then
WebBrowser1.Navigate((GetSetting("MyApp", "URLs", txtAddress.text))

Else

Try
WebBrowser1.Navigate(TxtAddress.Text)
Catch ex as Exception
End Try

End if

[/php]

Still dunno if that's what you want but that allows the user to create quick-URLs so when they type that word into the address bar it opens the assigned URL. You can make it more advanced/functional as you wish but that's the basics. Might need a bit of bug-proofing but hope you get the general idea.
Quote Originally Posted by hopefordope View Post
i meant that i use my textbox as the navigator

what i meant was...

if i press the button it adds the webpage's full url which is sometimes quite long..... so i was wondering if i can rename the long url to something short but it still navigates to the original url.
Code:
 Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        textbox1.text = WebBrowser1.Document.Url.AbsoluteUri
    End Sub
For the web browser the user can allows to create the quick links which it can be performed in a address bar it opens the assigned that URL . which it can be performed on the URL .
Posts 16–18 of 18 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us