Index

返回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
Dim
idx As Integer = lvw.Rows("张三").Index
Messagebox.Show(
"张三位于" & (idx + 1) & "行","提示")


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