[单选题]

窗体上有1个名称为List的列表框,其中已经输入了若干个项目(如图所示):还有2个文本框,名称分别为Text1、Text2, 1个名称为 Command1的命令按钮,并有以下程序

Private Sub Command1_Click()

D.im str As String, s As String, k As Integer

s=Text1

Str=””

F.or k=List1.ListCount-1 to 0 Step-1

If InStr(List.List(k),s)>0 then

str=str&List.List(k)&” ”

E.nd If

Next k

If str=””Then

Text2=”没有匹配的项目”

E.lse

Text2=str

E.nd If

E.nd Sub

程序运行时,在Text1中输入“京”,单击命令按钮,则在Text2中显示的内容是( )。

A.京

B.北京 南京

C.南京

D.没有匹配的项目

参考答案与解析: