❓ [HELP]Webbrowser History[Solved]

Posts 1–15 of 29 · Page 1 of 2
❓ [HELP]Webbrowser History[Solved]
I want to update my web browser to keep a history of websites entered into the comx. I want to have the history to be viewable in the comx only when it is dropped down just like IE and most other browsers. I just can't make it work. I tried a couple thigns but all failed. Can anyone help me out?
Hmm. I think it'll be best to ask Mnpeepno, i think he had that working. Its probably like some setting.
Okay. I'll try to google it again and see what i can find.

Still if anyone knows how post here or pm me.

Edit: There is nothing on the web about it. I could just make it with a separate combo box but i would rather intergrate it into the combo box i use to navigate. Anyone?
Alright good luck!!
Ok I have the following idea, idk if it works though.

Textbox1 = URL
Listview1 = Contains a list of visited Urls(No double urls)

Click on the listview, hit columns...

Add > Rename the text to URL

Just written this for you lol =D

Code:
Public Class Form1

    Private Sub savelv()
        Dim Fb As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()

        Dim FS As New System.IO.FileStream(Application.StartupPath & "\listview.txt", IO.FileMode.Create)
        Fb.Serialize(FS, New ArrayList(ListView1.Items))
        FS.Close()
    End Sub



    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown



        If e.KeyCode = Keys.Enter Then
            WebBrowser1.Navigate(TextBox1.Text)

            While Not WebBrowser1.ReadyState = WebBrowserReadyState.Complete

                Application.DoEvents()

            End While

            Try
                Additem()
            Catch
                MsgBox(ErrorToString)
            End Try
        End If

        savelv()

    End Sub

    Private Sub Additem()
        If ListView1.FindItemWithText(TextBox1.Text) Is Nothing Then

            Dim lv As ListViewItem = ListView1.Items.Add(TextBox1.Text)
            'The remaining columns are subitems   
            'lv.SubItems.Add(item)
        End If

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ListView1.View = View.Details
        ListView1.FullRowSelect = True

        Try
            Dim Fb2 As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
            Dim FS2 As New System.IO.FileStream(Application.StartupPath & "\listview.txt", IO.FileMode.Open)
            ListView1.Items.AddRange(Fb2.Deserialize(FS2).ToArray(GetType(ListViewItem)))
            FS2.Close()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub cmdremoveselected_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdremoveselected.Click
        ListView1.Items.Remove(ListView1.FocusedItem)

        savelv()
    End Sub
    Private Sub cmdclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdclear.Click
        ListView1.Items.Clear()

        savelv()
    End Sub

    Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
        TextBox1.Text = WebBrowser1.Url.AbsoluteUri
    End Sub
End Class
Have fun.

You might also add a else to the listview adding and make a second column containing "Times Visited".

Or something like this.

Url | Name | Times Visited
__________________________________________________ _____________________________________

To get the name do the following..

Webbrowser1.document.title
Nice work, but he asked to do it for ListBox. Any ideas?
Quote Originally Posted by Invidus View Post
Nice work, but he asked to do it for ListBox. Any ideas?
It is nicer to use a listview IMO =D
No but he's using ListBox for the URL. And when he clicks the drop-down button, the list of dlls come out.
/Facepalm
Sometimes people just don't read..
You have neither read his post. He wants to have the history in a comBobox. You can probably just get the items of the listview in the comBobox...sooooooooooooo...

something similar to

For Each i As ListViewItem In ListView1.Items
ComboBox1.Items.Add(i)
Next

So you can make an editable listview in the settings or so...

//good solution IMO
Quote Originally Posted by Blubb1337 View Post
You have neither read his post. He wants to have the history in a comBobox. You can probably just get the items of the listview in the comBobox...sooooooooooooo...

something similar to

For Each i As ListViewItem In ListView1.Items
ComboBox1.Items.Add(i)
Next

So you can make an editable listview in the settings or so...

//good solution IMO
Lol you definitely can't read
You didn't read MY post.
He meant the history to be dropped down in the comx.. Like IE..
So the most visited sites show up..
/facepalm
That's what I'm talking about, duh.
Thats what i said
/ME
Gawd....I'll just rewrite it using a comBobox....give me a few seconds..............................
:P kay good job. Hope this'll be good.


A. For temp history Use

[php]
Comx1.items.add
[/php]

On your go button click event

B. If updating your web browser, also add the combox auto complete source to your history listbox/listview which you should have on a separate form so users can view thier history as well.


C. In which case to use the above, you should use blubbs code.


or be alittle more extensive and use
on go button
Create a history setting

[php]

My.Settings.history.Add(Comx1.text)
My.Settings.Save()

[/php]

Form load

[php]
Dim hist As String = ""
For Each history As String In My.Settings.history
hist &= history & vbCrLf
Next
Comx1.items.add(hist)
[/php]

Or something like that.
don't have vb with me, Not at home/office this morning.


also be sure that no matter what method you use, check for duplicates and negate them

Posts 1–15 of 29 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us