I'm very new to the whole programming thing and I'm having a little trouble with the syntax of my code.
My code contains a bound listbox where the display member and value member are two different values. I want my program to cycle through the listbox and compare the value member of each item in the list box with a fixed value. My problem is I can't seem to find the syntax to grab the value of the item in the list box. I can't use DescriptionList Box.SelectedVal ue. Because the item is not selected. This is an example of some code I've tried, but it is not working.
For count As Integer = 0 To DescriptionList Box.Items.Count - 1
If DescriptionList Box.Items.Item( count).value = Me.DataSet.Tabl e.Rows(i).Item( 1) then
DescriptionList Box.SetSelected (count, True)
end if
Next
I guess my question is what can I use in place of ListBox.Selecte dValue, to capture the Value of a bound listbox's item that is not selected?
My code contains a bound listbox where the display member and value member are two different values. I want my program to cycle through the listbox and compare the value member of each item in the list box with a fixed value. My problem is I can't seem to find the syntax to grab the value of the item in the list box. I can't use DescriptionList Box.SelectedVal ue. Because the item is not selected. This is an example of some code I've tried, but it is not working.
For count As Integer = 0 To DescriptionList Box.Items.Count - 1
If DescriptionList Box.Items.Item( count).value = Me.DataSet.Tabl e.Rows(i).Item( 1) then
DescriptionList Box.SetSelected (count, True)
end if
Next
I guess my question is what can I use in place of ListBox.Selecte dValue, to capture the Value of a bound listbox's item that is not selected?
Comment