Sub
Command1_Click()
Dim
xx
As
ListItem
Set
xx
=
ListView1.ListItems.Add(,
,
"1111")
xx.SubItems(1)
=
"2222"
xx.SubItems(2)
=
"3333"
End
Sub
Private
Sub
Form_Load()
ListView1.View
=
lvwReport
ListView1.ColumnHeaders.Add
,
,
"第1列",
1000
ListView1.ColumnHeaders.Add
,
,
"第2列",
1000
ListView1.ColumnHeaders.Add
,
,
"第3列",
1000
End
Sub
Private Sub Command1_Click()
Dim item As ListItem
Set item = ListView1.ListItems.Add(, , Text1)
item.SubItems(1) = Text2
item.SubItems(2) = Text3
item.SubItems(3) = Text4
End Sub
Private Sub Form_Load()
With ListView1
.View = lvwReport
.ColumnHeaders.Add , , "a"
.ColumnHeaders.Add , , "b"
.ColumnHeaders.Add , , "c"
.ColumnHeaders.Add , , "d"
End With
End Sub
这个列表我也是刚学,只弄懂了怎么添加,列表的第一列是主项,通过ListItems.Add添加,其它列是该项目下子项,通过该主项的子项数组SubItems赋值,下标从1开始。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)