如图所示,在列表框List1中已经有若干人的简单信息,运行时在Text1文本框(即“查 找对象”右边的文本框)输入一个姓或姓名,单击“查找”按钮,则在列表框中进行查 找,若找到,则把该人的信息显示在Text2文本框中。若有多个匹配的列表项,则只显 示第1个匹配项;若未找到,则在Text2中显示“查无此人”。请填空。
Private Sub Command1_Click()
Dim k As Integer, n As Integer, found As Boolean found = False
n = Len( _________)
k = 0
While k < List1.ListCount And Not found
If Text1 = Left$(List1.List(k), n) Then
Text2 = _________
found = True
End If
k = k + 1
Wend
If Not found Then
Text2 = "查无此人" End If
End Su