大家帮忙看下代码有没有错,总是发生错误提示
listview1.rar
(53.43 KB)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListView1.Items.Clear()
ListView1.Columns.Clear()
ListView1.Columns.Add("栏1", 130, HorizontalAlignment.Left)
ListView1.Refresh()
Dim LItem As ListViewItem
For i As Integer = 1 To 50
LItem = New ListViewItem(i)
ListView1.Items.Add(LItem)
Next
ListView1_Click(ListView1, New System.EventArgs())
End Sub
Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click
MsgBox(ListView1.SelectedItems.Item(0).SubItems(0).Text)
End Sub
[ 本帖最后由 cpg4 于 2009-11-1 15:54 编辑 ]