Jan 14th, 2008, 12:43 PM
#1
Thread Starter
Hyperactive Member
History memory on WebBrowser
How do I make a combbox that remembers history in vb.NET
How can I make a favourites menu strip that lets the explorer save favourite information to next time i open explorer?
Last edited by fenhopi; Jan 14th, 2008 at 12:46 PM .
Jan 14th, 2008, 12:51 PM
#2
Frenzied Member
Re: History memory on WebBrowser
Really broad question..
Do you have experience saving and loadings things to and from an external file, respectively?
Jan 14th, 2008, 12:55 PM
#3
Re: History memory on WebBrowser
you could save the information in a my.settings stringcollection
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 14th, 2008, 01:25 PM
#4
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
Really broad question..
Do you have experience saving and loadings things to and from an external file, respectively
No, I don't is it hard?
you could save the information in a my.settings stringcollection
Not sure how to do that..
Jan 14th, 2008, 01:42 PM
#5
Re: History memory on WebBrowser
look in Project-->Properties-->Settings tab
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 14th, 2008, 01:45 PM
#6
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
oh, I see. Any idea how I adjust it to do what I want it to?
Jan 14th, 2008, 01:56 PM
#7
Re: History memory on WebBrowser
in Project-->Properties-->Settings tab, change name to history, change type to stringcollection. you use a stringcollection like this:
vb Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.history Is Nothing Then
My.Settings.history = New Specialized.StringCollection
My.Settings.history.Add("one")
My.Settings.history.Add("two")
My.Settings.history.Add("three")
My.Settings.Save()
End If
Dim msg As String = ""
For Each history As String In My.Settings.history
msg &= history & vbCrLf
Next
MsgBox(msg)
End Sub
End Class
Last edited by .paul.; Jan 15th, 2008 at 06:33 PM .
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 14th, 2008, 02:09 PM
#8
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
Thank you very much, I gave you a good rate for it.
Jan 14th, 2008, 02:14 PM
#9
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
yeah, and how do I connect the strings to the combobox?
Jan 14th, 2008, 02:38 PM
#10
Re: History memory on WebBrowser
MsgBox(My.Settings.history(combobox1.selectedindex))
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 14th, 2008, 02:55 PM
#11
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
I get an error on the
Code:
MsgBox(My.Settings.history(ComboBox1.SelectedIndex))
it says index out of range, in needs to be not-negative and smaller then the size of your collection.
Jan 14th, 2008, 03:24 PM
#12
Re: History memory on WebBrowser
have you added all the items in the combobox to your history setting?
or, is the combobox empty? i.e. selectedindex = -1
when you load the program you should add all the history settings to the combobox
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 14th, 2008, 04:03 PM
#13
Thread Starter
Hyperactive Member
Re: History memory on WebBrowser
I tried it all, it won't work..
Jan 14th, 2008, 04:35 PM
#14
Re: History memory on WebBrowser
heres a demonstration. it displays your history (descriptions) in the listbox. if you click an item in the listbox it'll display a msgbox withe the full URL + description as saved in my.settings.history
see attachment
vb.net Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.history Is Nothing Then
My.Settings.history = New Specialized.StringCollection
My.Settings.history.Add("http://www.google.co.uk/search?hl=en&q=stringcollection+vb.net&btnG=Google+Search&meta=" & "," & "google search 'stringcollection'")
My.Settings.history.Add("http://www.devasp.net/net/articles/display/233.html" & "," & "working with stringcollection")
My.Settings.history.Add("http://www.dotnet247.com/247reference/System/Collections/Specialized/StringCollection.aspx" & "," & "System.Collections.Specialized.StringCollection Class")
My.Settings.Save()
End If
For Each history As String In My.Settings.history
Dim strArray() As String = history.Split(",")
ListBox1.Items.Add(strArray(1))
Next
End Sub
Attached Files
Last edited by .paul.; Jan 15th, 2008 at 06:40 PM .
Coding Examples:
Features:
Online Games:
Compiled Games:
Dec 12th, 2015, 08:03 PM
#15
Re: History memory on WebBrowser
I know this is a old post goodness....But i got a question about it lol.....I am using a multi tab browser and would instead like the items displayed into a list box on another form. At this point im getting into a tangled up mess of confusion lol any tips or could someone simplify for me? I think i finally understand it just dont know how to contstruct it.
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