I have this code in vb6:
Public Sub SetDepartment(ByRef cbo As ComboBox, ByVal lDepartmentID As Long)
Dim lCounter As Long
With cbo
If .ListCount = 0 Then Exit Sub
For lCounter = 0 To .ListCount - 1
If lDepartmentID = .ItemData(lCounter) Then
.ListIndex = lCounter
End If
Next
End With
End Sub
So I have an ID and need to search this ID in the list of ValueMember. When I get the ID, I need to display the counterpart from DisplayMember list.
How do I do this in vb.net?
Please and thank you,
Alex
Public Sub SetDepartment(ByRef cbo As ComboBox, ByVal lDepartmentID As Long)
Dim lCounter As Long
With cbo
If .ListCount = 0 Then Exit Sub
For lCounter = 0 To .ListCount - 1
If lDepartmentID = .ItemData(lCounter) Then
.ListIndex = lCounter
End If
Next
End With
End Sub
So I have an ID and need to search this ID in the list of ValueMember. When I get the ID, I need to display the counterpart from DisplayMember list.
How do I do this in vb.net?
Please and thank you,
Alex