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 xx As ListItem
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" Then
Set xx = ListView1.ListItems.Add(, , Text1.Text)
xx.SubItems(1) = Text2.Text
xx.SubItems(2) = Text3.Text
Set xx = Nothing
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
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
把 dim Itm as ListItem 改成 dim Itm 就行了问题所在是你工程中同时应用的有 5.0和6.0版同时存在。 让系统自适应去就是了。
代码没什么问题。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)