窗体上有1个名称为List的列表框,其中已经输入了若干个项目(如图所示):还有2个文本框,名称分别为Text1、Text2, 1个名称为 Command1的命令按钮,并有以下程序Private Sub Command1_Click()Dim str As String, s As String, k As Integers=Text1Str=””For k=List1.ListCount-1 to 0 Step-1If InStr(List.List(k),s)0 thenstr=strList.List(k)” ”End IfNext kIf str=””ThenText2=”没有匹配的项目”ElseText2=strEnd IfEnd Sub程序运行时,在Text1中输入“京”,单击命令按钮,则在Text2中显示的内容是( )。A.京B.北京 南京C.南京D.没有匹配的项目

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

Private Sub Command1_Click()

Dim str As String, s As String, k As Integer

s=Text1

Str=””

For k=List1.ListCount-1 to 0 Step-1

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

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

End If

Next k

If str=””Then

Text2=”没有匹配的项目”

Else

Text2=str

End If

End Sub

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

A.京

B.北京 南京

C.南京

D.没有匹配的项目


相关考题:

在窗体上有一个名称为Label1的标签和一个名称List1的列表框。程序运行后,在列表框中添加若干列表项。当双击列表框中的某个项目时,在标签Labe1中显示所选中的项目,如图所示。请在空白处填入适当的内容,将程序补充完整。Private Sub Form_Load()List1.AddItem "北京"List1.AddItem "上海"List1.AddItem "河北"End SubPrivate Sub List1 【9】 ()Labe1.Caption= 【10】End Sub

窗体上有一个名为List1的列表框,其中已经输入了若干个项目(如图所示);还有两个文本框,名称分别为Text1、Text2,一个名称为Command1的命令按钮,并有以下程序: Private Sub Command1_Click() Dim str As String,s As String,k As Integer s=Text1 str="" For k=List1.ListCount-1 To 0 Step-1 IfInStr(List1.List(k),s)>0 Then str=strList1.List(k)" " End If Next k If str="" Then Text2="没有匹配项目" Else Text2=str End If End Sub 程序运行时,在Text1中输入“京”,单击命令按钮,则在Text2中显示的内容是______。A.京B.北京 南京C.南京 北京D.没有匹配的项目

在窗体上画一个名称为List1的列表框,一个名称为Label1的标签,列表框中显示若干个项目。当单击列表框中的某个项目时,在标签中显示被选中项目的名称。下列能正确实现上述操作的程序是( )。A.Private Sub List1_Click()Label1.Caption = List1.ListIndexEnd SubB.Private Sub List1_Click()Label1.Name=List1.ListIndexEnd SubC.Private Sub List1_Click()Label1.Name=List1.TextEnd SubD.Private Sub List1_Click()Label1.Caption =List1.TextEnd Sub

在窗体上绘制一个名称为List1的列表框,一个名称为Label1的标签,列表框中显示若干个项目。当单击列表框中的某个项目时,在标签中显示被选中的项目的名称。下列能正确实现上述操作的程序是 。A.Private Sub List1_Click()Labell.Caption=List.ListIndex End SubB.Private Sub List1_Click()Labell.Name=List1.ListIndex End SubC.Private Sub List1_Click()Labell.Name=List1.Text End SubD.Private Sub List1_Click()Labell.Caption=List.Text End Sub

在窗体上画一个名称为List1的列表框,一个名称为Label1的标签,列表框中显示若干个项目。当单击列表框中的某个项目时,在标签中显示被选中项目的名称。下列能正确实现上述操作的程序是A.Private Sub List1_Click( ) Label1.Caption=List1.List1ndex End SubB.Private Sub List1_Click( ) Label1.Name=List1.List1ndex End SubC.Private Sub List1_Click( ) Label1.Name=List1.Text End SubD.PrivateSubList1_Click( ) Label1.Caption=List1.Text End Sub

在窗体上绘制一个名称为List1的列表框,一个名称为Labe11的标签,列表框中显示若干个项目。当单击列表框中的某个项目时,在标签中显示被选中项目的名称。下列能正确实现上述操作的程序是A.PriVate Sub List1_Click() Labell.CaptiOn=List.ListIndex End SubB.PriVate Sub List1_Click() Labell.Name=listl.ListIndex End SubC.Private Sub List1_Click() Labell.Name=Listl.Text End SubD.Private Sub List1_Click() Labell.Caption=List1.Text End Sub

窗倒上有1个名为List1的列表框,其中已经输入了若干个项目(如图3所示);还有2个文本框,名称分别为Text1、Text2,1个名称为Command1的命令按钮,并有以下程序:程序运行时,在Text1中输入“京”,单击命令按钮,则在Text2中显示的内容是( )。A. 京B. 北京南京C. 南京北京D. 没有匹配的项目

( 30 ) 窗体上有 1 个名称为 List 的列表框 , 其中已经输入了若干个项目 ( 如图所示 ) : 还有 2 个文本框 ,名称分别为 Text1 、 Text2, 1 个名称为 Command1 的命令按钮,并有以下程序Private Sub Command1_Click ()Dim str As String, s As String, k As Integers=Text1Str= ””For k=List1.ListCount-1 to 0 Step-1If InStr ( List.List ( k ) ,s ) 0 thenstr=strList.List ( k ) ” ”End IfNext kIf str= ”” ThenText2= ” 没有匹配的项目 ”ElseText2=strEnd IfEnd Sub程序运行时,在 Text1 中输入 “ 京 ” ,单击命令按钮,则在 Text2 中显示的内容是( )A ) 京B ) 北京 南京C ) 南京D ) 没有匹配的项目

窗体上有1个名称为List1的列表框,其中已经输入了若干个项目,如图所示;还有2个文本框,名称分别为Text1、Text2,1个名称为Command1的命令按钮,并有下列事件过程。 Private Sub Command1_Click( ) Dim str As String,S As String.k As Integer s=Text1 str ="" For k=Listl.ListCount-1 To 0 Step-1 If InStr(List1.List(k),s)0 Then str=str & List1.List(k)&"" End If Next k If str=""Then Text2="没有匹配的项目" Else Text2=str End If End Sub程序运行时,在Text1中输入"京",单击命令按钮,则在Text2中显示的内容是( )。A.京B.北京南京C.南京北京D.没有匹配的项目