|
-
Feb 26th, 2009, 03:43 AM
#1
Thread Starter
New Member
[2008] Favourites Save and Name
Hi guys, I'm trying to save my favorites, I made a Listbox1 that contains the URL and that will record the URL when you click the add button, and that all works. The only problem is saving, whenever I close it, it won't save, Heres the code;
Code:
Public Class favorites
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
My.Settings.FavList.Add(CType(Form1.TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString)
ListBox1.Items.Add(CType(Form1.TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString)
My.Settings.Save()
End Sub
Private Sub cbxFavourites_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxFavourites.SelectedIndexChanged
CType(Form1.TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(cbxFavourites.SelectedItem.ToString)
End Sub
Private Sub favorites_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
My.Settings.Save()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
CType(Form1.TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ListBox1.SelectedItem.ToString)
End Sub
Private Sub favorites_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
My.Settings.Reload()
End Sub
End Class
Also I want to make a textbox that records what goes into it, and instead of showing the URL on the listbox I want it to the show the name they give it. Is this possible?
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
|