Group

返回或设置行所属的分组。

示例

Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim
nms1() As String = {"张飞","关羽","张云","马超","黄忠"}
Dim
nms2() As String = {"庞统","徐庶","孔明","程昱","贾栩"} 
lvw.Groups.Add(
"武将") '添加分组
lvw
.Groups.Add("谋士") '添加分组
For
Each nm As String In nms1
    Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
    vr.Text = nm 
'
设置行标题
    vr.Group =
"
武将"  '设置行的分组
Next
For
Each nm As String In nms2
    Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
   
vr.Text = nm  '设置行标题
    vr.Group = "谋士" 
'设置行的分组

Next


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