ListView应用啊,帮忙
ption ExplicitDim itmX As ListItem '定义一个ListItem对象
Dim a
Dim key As String '定义字符串变量
Private Sub Form_Load()
Adodc1.RecordSource = "select * from tb_enter order by number"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
ListView1.Enabled = True
ListView1.ListItems.Clear
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
key = Text1.Text
Set itmX = ListView1.ListItems.Add(, , key, 1)
Adodc1.Recordset.MoveNext
Loop
Else
ListView1.Enabled = False
End If
ListView1.StartLabelEdit
ListView1.LabelEdit = lvwAutomatic
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Label1.Caption = "当前选择人员: " & ListView1.SelectedItem.Text
End Sub
key = Text1.Text 什么作用啊