VB listview删除指定行
listview中有5行,为:111222333444555我想删除444的那一行,是根据内容删除,不是根据INDEX的,求解!...
listview中有5行,为: 111 222 333 444 555 我想删除444的那一行,是根据内容删除,不是根据INDEX的,求解!
展开
2013-05-12
展开全部
Private Sub Command1_Click()
Dim i As Long
For i = Me.ListView1.ListItems.Count To 1 Step -1
If Me.ListView1.ListItems.Item(i) = "4444" Then
Call Me.ListView1.ListItems.Remove(i)
End If
Next
End SubPrivate Sub Form_Load()
Dim tL As ListItem
Dim i As Long
Me.ListView1.View = lvwList
For i = 1 To 5
Set tL = Me.ListView1.ListItems.Add(, , String(4, CStr(i)))
Next
End Sub
Dim i As Long
For i = Me.ListView1.ListItems.Count To 1 Step -1
If Me.ListView1.ListItems.Item(i) = "4444" Then
Call Me.ListView1.ListItems.Remove(i)
End If
Next
End SubPrivate Sub Form_Load()
Dim tL As ListItem
Dim i As Long
Me.ListView1.View = lvwList
For i = 1 To 5
Set tL = Me.ListView1.ListItems.Add(, , String(4, CStr(i)))
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |