G
Guest
Hi I'm trying to remove duplicate elements from
a Drop Down List Fill in VB.net.
Following code worked well with vb6. But I'm getting index out of range if I
try to translate it to vb.net code at line#4. Any possible clues will be
appreciated. Thanks.
'To distill the Combo Element
NumY = Combo5.ListCount + 1 '''''''''''''''Line1
For NumX = 1 To Combo5.ListCount '''''''line2
NumY = NumY - 1 '''''''line3
If (Combo5.List(NumY) = Combo5.List(NumY - 1)) Then
''''''line4
Combo5.RemoveItem (NumY) '''''''''''''line5
End If '''''line6
Next ''''line7
---------------In vb.net---------------
a Drop Down List Fill in VB.net.
Following code worked well with vb6. But I'm getting index out of range if I
try to translate it to vb.net code at line#4. Any possible clues will be
appreciated. Thanks.
'To distill the Combo Element
NumY = Combo5.ListCount + 1 '''''''''''''''Line1
For NumX = 1 To Combo5.ListCount '''''''line2
NumY = NumY - 1 '''''''line3
If (Combo5.List(NumY) = Combo5.List(NumY - 1)) Then
''''''line4
Combo5.RemoveItem (NumY) '''''''''''''line5
End If '''''line6
Next ''''line7
---------------In vb.net---------------