By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,408 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,408 IT Pros & Developers. It's quick & easy.

How do you save the contents of a Listbox?

P: n/a
I need to save the contents of a listbox in a serializable object.
I not only need the values but the index positions as well.

For example, a listbox with 3 entries may look like this:
Index Value
0 x
1 y
2 z

What should I store these in? (An array, hashtable, etc)
What is the simplest way to move the values from the list box to the new
object?

Thanks!
--
Joe Fallon


Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Joe Fallon wrote:
I need to save the contents of a listbox in a serializable object.
I not only need the values but the index positions as well.

For example, a listbox with 3 entries may look like this:
Index Value
0 x
1 y
2 z

What should I store these in? (An array, hashtable, etc)
What is the simplest way to move the values from the list box to the
new object?

Thanks!


If you really need the index, I would use a hash table.
I would reccomend just using an ArrayList, and its built-in indices.

- Pete
Nov 20 '05 #2

P: n/a
http://www.knowdotnet.com/articles/s...w-listbox.html
"Joe Fallon" <jf******@nospamtwcny.rr.com> wrote in message
news:#m**************@tk2msftngp13.phx.gbl...
I need to save the contents of a listbox in a serializable object.
I not only need the values but the index positions as well.

For example, a listbox with 3 entries may look like this:
Index Value
0 x
1 y
2 z

What should I store these in? (An array, hashtable, etc)
What is the simplest way to move the values from the list box to the new
object?

Thanks!
--
Joe Fallon

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.