ListViewRow
ListViewRow表示ListView的行。
通过ListView的Rows属性,可以增加、删除行,或者获取指定位置或名称的行。
示例:
Dim
lvw As
WinForm.ListView
= e.Form.Controls("ListView1")
Dim
nms() As
String = {"张三","李四","王五","赵六"}
For
Each
nm
As
String
In
nms
Dim
vr
As
WinForm.ListViewRow
= lvw.Rows.Add()
vr.Text
= nm
'设置行标题
vr.Name
= nm
'设置行的名称
Next
If
lvw.Rows.Contains("王五")
Then
'判断是否存在名为王五的行
lvw.Rows("王五").Text
= "我是王五"
'修改该王五的标题
End If
lvw.Rows.Delete(0)
'删除第一行