How do you save the contents of a Listbox?

  • Thread starter Thread starter Joe Fallon
  • Start date Start date
J

Joe Fallon

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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top