VB如何向ListView添加数据

我要达到的效果是:
单击Command1自动在listview中添加一条数据,并自动清空text中的数据!
最好有详细代码!或发到邮箱:[email protected]!谢谢!分数看效果给分!

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

温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-12-12
hi我吧。保证你给200分
相似回答