|
-
Jul 10th, 2010, 07:03 AM
#1
Thread Starter
Fanatic Member
Listbox Favourites
Ok i am on my webbrowsers favourites, and im looking to use a listbox so the user can have as many as they want. Also i want the listbox to show the Site Title, like so it just shows the title of that website. But then i wouldn't know how to navigate to that website if just the title is in the listbox How would i do this?
-
Jul 10th, 2010, 07:09 AM
#2
Re: Listbox Favourites
This is easily accomplished by having the title linked to the URL.
The listbox is not going to store your favorites...it is only going to display what has already been stored. Where are you actually storing them?
-
Jul 10th, 2010, 09:22 AM
#3
Thread Starter
Fanatic Member
Re: Listbox Favourites
What do you mean? What im doing is on favourite add button i want to add a favourite with the site title to the listbox but i dont know how to get the listbox to store the URL for that favourite because i dont want the URL in the listbox.
-
Jul 10th, 2010, 09:45 AM
#4
Re: Listbox Favourites
You can bind a list of any type of objects to a ListBox and then use the DisplayMember to specify which column/property of the items to display.
What Hack is saying is that the ListBox will display your data while the app is running but as soon as the app exits the ListBox ceases to exist so it can't help you then. If you expect your data to be persisted between sessions then you must be saving it somewhere. Where? How? In what format?
-
Jul 10th, 2010, 10:03 AM
#5
Thread Starter
Fanatic Member
Re: Listbox Favourites
 Originally Posted by jmcilhinney
You can bind a list of any type of objects to a ListBox and then use the DisplayMember to specify which column/property of the items to display.
How would i do this?, and dam yea how would i save each favourite as a new one is added into an .ini file because i have a settings.ini already for the application.
-
Jul 10th, 2010, 10:09 PM
#6
Thread Starter
Fanatic Member
Re: Listbox Favourites
Ok i see that in the designer there is DisplayMember and a Value member , im guessing the display would be the Webpage title and the value be the URL but how do i sort it out to save each of these?
-
Jul 10th, 2010, 11:49 PM
#7
Re: Listbox Favourites
There are various ways. You could use multiple StringCollections in My.Settings. You could put all the data into a single String with delimiters between each pair of values and records. The String could then be saved to My.Settings or a text file or whatever. You might also create a list of objects with the appropriate properties and then serialise that list. The choice is yours.
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
|