Name

返回或设置ListViewRow的名称。
行具备名称之后,可以通过名称检索行。

示例

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 '判断是否存在名为王五的行
    Messagebox.Show("王五已经存在")

End
If


本页地址:http://www.foxtable.com/webhelp/topics/2855.htm