Listbox Save / Load in Settings

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts Page 1 of 1
Contributors
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

Listbox Save / Load in Settings
CleverBoy
Hello guys i need help on how i save and load listbox items in my.settings
the first good answer = 10 C
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

You would need a maximum amount of items. As far as I know, you cannot create a new Setting at runtime. But you can use My.Settings and Strings to use the .Split function and remove commas and .Join commas to load into a listbox. I will be back with some code, if I figure it out.
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Listbox Save / Load in Settings
Axel
go to settings , make a new specializedstringcollection(you'll need to browse for system.collections.specializedstringcollection)
Code: Select all
For each item as string in listbox1.items
My.Settings.collection.Add(item)
My.settings.save()
next 
load :
Code: Select all
For each item as string in my.settings.collection
Listbox1.items.add(item)
Next
I didn't test this but it should work !
http://vagex.com/?ref=25000
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

@GoodGuy17
i see before months code like this
for i = blah blah.listbox(Save)
my.setings.add(i)
listbox1.count -1

i forget it so the code is like this
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

@axel
i got error
Object reference not set to an instance of an object.
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Listbox Save / Load in Settings
Axel
CleverBoy wrote:
@axel
i got error
Object reference not set to an instance of an object.
Where does that appear ?
http://vagex.com/?ref=25000
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

and i test it in another way it works but every time i load 1 new item added on the top of items " " on space :S
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

Fix the problem thanks for all
Axel + GoodGuy17
PM with download for 6 credits so you will get 5 c
ok?

LOCK TOPIC
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
8 posts Page 1 of 1
Return to “Tutorial Requests”