I posted this in the Visual Basic Forum, but I've been wondering if .NET might be a better place for it. I'm working in Visual Basic Microsoft Visual Studio .NET 2005.
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 counting As Integer = 0 To DescriptionList Box.Items.Count - 1
If DescriptionList Box.Items.Item( counting).value = Me.DataSet.Tabl e.Rows(i).Item( 1) then
DescriptionList Box.SetSelected (counting, 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?
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 counting As Integer = 0 To DescriptionList Box.Items.Count - 1
If DescriptionList Box.Items.Item( counting).value = Me.DataSet.Tabl e.Rows(i).Item( 1) then
DescriptionList Box.SetSelected (counting, 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