I am using visual studio 2008 with vb as my language. I have a databound multiextended listbox. I need to get the selected value for each item that is selected. I have searched for two weeks trying to find and answer. Can anyone help? I would greatly appreciate it.
A:
How about this:
For Each Item In ListBox1.SelectedItems
//Do Stuff here to the item
Next
daft
2010-06-17 06:52:46
rip
2010-06-18 05:20:37
A:
when i try this:
For Each item In ListBox1.SelectedItems
Label10.Text = Label10.Text + item.ToString & vbCrLf
Next
i get the following result int he label10 text:
chirp_Sql.status
chirp_Sql.status
chirp_Sql.status
chirp_Sql is the name of my database and status is the name of the field. How can I get the actual value instead of that? Thanks for the help.
rip
2010-06-18 05:22:13
What are the actual values that you are displaying in the listbox? When I use the above code I can easily present the actual items in a label and select multiple values in the listbox using Ctrl + Left click without any problems.
daft
2010-06-18 06:45:51
A:
Something is up with the way you are binding your data to the listbox in the first place, or you need to do a "DirectCast" of the item before you can see it's contents.
Carter
2010-07-26 22:38:25