I
IMK
Hello all,
Sorry if this issue has come up already but I am new to vb.net.
Thanks.
I am trying to retrieve the selectedvalues from a multiselect list box
in a vb 2005 winform. Here is the code I am using so far:
dim i as object
For Each i In Me.lstUnitPicklist.SelectedItems
MessageBox.Show(Me.lstUnitPicklist.SelectedValue)
Next
Eventually I will replace the messagebox with the name of a sub that
will take the selectedvalue as a parameter.
The problem is that, as the code goes through each selected item, it
returns only the first selected value repeatedly for the number of
selected items.
In other words, If the listbox was a listbox of colors and I had
selected "blue", then "green" then "yellow" the code would show
"blue", "blue", "blue" then stop.
I have used similar code before and it worked fine. Is there another
way to do this? It seems so simple, but I am stumped.
Sorry if this issue has come up already but I am new to vb.net.
Thanks.
I am trying to retrieve the selectedvalues from a multiselect list box
in a vb 2005 winform. Here is the code I am using so far:
dim i as object
For Each i In Me.lstUnitPicklist.SelectedItems
MessageBox.Show(Me.lstUnitPicklist.SelectedValue)
Next
Eventually I will replace the messagebox with the name of a sub that
will take the selectedvalue as a parameter.
The problem is that, as the code goes through each selected item, it
returns only the first selected value repeatedly for the number of
selected items.
In other words, If the listbox was a listbox of colors and I had
selected "blue", then "green" then "yellow" the code would show
"blue", "blue", "blue" then stop.
I have used similar code before and it worked fine. Is there another
way to do this? It seems so simple, but I am stumped.