Private Sub Command1_Click()
For i = 0 To Combo1.ListCount - 1
If Mid(Combo1.List(i), 1, 3) = Text1.Text Then
Label2.Caption = "姓 名 英语 数学 VB" + vbCrLf + Combo1.List(i)
Exit For
End If
If i = Combo1.ListCount - 1 Then
Label2.Caption = "查无此人!"
End If
Next i
End Sub
Private Sub Form_Load()
Combo1.AddItem "王宏伟" + Space(2) & 86 & Space(2) & 75 & Space(2) & 81
Combo1.AddItem "赵桂香" + Space(3) & 91 & Space(4) & 86 & Space(3) & 92