VB.NET Listbox1列表中的重复数据怎么删除
vb.net吧
全部回复
仅看楼主
level 9
1johnn 楼主

1
22
3
22
怎么删除重复的数据
只留一个22
2012年10月21日 13点10分 1
level 8
Dim iii As Integer = 0, arl As New ArrayList
Do Until iii = Me.ListBox1.Items.Count
Dim str As String = Me.ListBox1.Items(iii)
If arl.IndexOf(str) <> -1 Then
Me.ListBox1.Items.RemoveAt(iii)
Else
arl.Add(str)
iii += 1
End If
Loop
arl.Clear()
arl = Nothing
我写个笨方法
2012年10月21日 16点10分 2
level 8
这个 也可以
Dim iii As Integer = 0
Do Until iii = Me.ListBox1.Items.Count
Dim str As String = Me.ListBox1.Items(iii)
If Me.ListBox1.Items.IndexOf(str) <> iii Then
Me.ListBox1.Items.RemoveAt(iii)
Else
iii += 1
End If
Loop

2012年10月21日 16点10分 3
谢谢哈[HI]
2012年10月22日 02点10分
1