如何向listview添加数据
1个回答
展开全部
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 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
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询