Hi,
In a list box the user can select single or multiple values. Below is the
code given for reading the multiple text values of the listbox in a string
seperated by commas.
Dim lCtr
Dim strText as String
If listBox.Items.Count > 0 Then
For lCtr = 1 To lstBox.Items.Count
If istBox.Items(lCtr - 1).Selected = True Then
strText = lstBox.Items(lCtr - 1).Value
' Can have some code to append commas.......
End If
Next
End If
strText would be a string consistes od comma. You may also use the String
Builder class, if you want to optimise the string.
Please let me know if this is what you were looking for.....
Thanks and Regards,
Piyush
"tshad" wrote:
How do I get to the datatextfield of listbox?
I can get the the datavaluefield using the selectedvalue. I want to get the
text portion of the listbox that the user selected.
Thanks,
Tom