command1代码:
Dim x As String, i As Integer, s As Boolean
x = InputBox("请输入一个数:")
If List1.ListCount = 0 Then List1.AddItem (x)
s = True
For i = 0 To List1.ListCount - 1
If List1.List(i) = x Then
s = False
Exit For
End If
Next
If s Then List1.AddItem (x)
http://zhidao.baidu.com/question/120486056.html
呵呵 刚回答完
楼上的方法很好啊!!