Private Sub Command1_Click()
Dim i As Integer
If Text1.Text <> "" Then
For i = 0 To List1.ListCount - 1
If List1.List(i) = Text1.Text Then
List1.RemoveItem (i)
Exit For
End If
Next i
End If
End Sub
Private Sub Command1_Click()
For i = List1.ListCount - 1 To 0 Step -1
If List1.List(i) = Text1.Text Then List1.RemoveItem i
Next
End Sub
sub command1_click()
dim i as integer
for i = 0 to list1.listcount-1
if list1.list(i)=text1.text then
list1.removeitem(i)
end if
next
end sub
其实不需要循环这么麻烦的
list1.text=text1.text
List1.RemoveItem List1.ListIndex '删除list选中的一项
任务,任务,任务