题目
Option Base 1
Private Sub Command1_Click()
Dim city As Variant
city=_______(”北京”,”天津”,”上海”,”武汉”,”重庆”,”西宁”)
For i=_______ To UBound(city)
Combol.AddItem_______
Next
End Sub
第1题
(7 )设窗体上有一个名称为 Combol 的组合框,并有以下程序:
Private Sub Combol_KeyPress(KeyAscii As Integer)
If 【 9 】 =13 Then ‘ 回车符的 ASCII 码是 13
For k=0 To Combol.ListCount-1
If Combol.Text= Combol.List(k) Then
Combol.Text= ” ”
Exit For
End If
Next k
If Combol.Text <> “” Then
Combol.AddItem 【 10 】
End If
End If
End Sub
程序的功能是 : 在组合框的编辑区中输入文本后按回车键 , 则检查列表中有无与此文本相同的项目 , 若有 ,则把编辑区中的文本删除,否则把编辑区中文本添加到列表的尾部。请填空。
第2题
A.Combo1.RemoveItem Combo1.Text
B.Combo1.Removeltem4
C.Combo1.RemoveItem Combo1.ListCount
D.Combo1.RemoveItem5
第3题
窗体上有一个名称为Cb1的组合框,程序运行后,为了输出选中的列表项,应使用的语句是()。
A.Print Cb1.Selected
B.Print Cb1.List(Cbl.LisfIndex)
C.Print Cb1.Selected.Text
D.Print Cb1.List(ListIndex)
第4题
窗体上有一个名称为Cbl的组合框,程序运行后,为了输出选中的列表项,应使用的语句是
A.Print Cbl.Selected
B.Print Cbl.List(Cbl.ListIndex)
C.Print Cbl.Selected.Text
D.Print Cbl.List(ListIndex)
第5题
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii=13 Then
For i=0 To Combo1.ListCount-1
If Combo1.Text=【 】Then
Label2.Caption="输入项已在组合框中。"
Exit Sub
End If
Next i
Label2.Caption="已成功添加新输入项。"
Combo1.【 】Combo1.Text
End If
End Sub
第6题
A.A.Combo1.List(ListCount)
B.B.Combo1.List(Comb01.ListCount-1)
C.C.Combo1.List(ListCount-1)
D.D.Combo1.List(Comb01.ListCount)
第7题
窗体上有一个名称为Cbl的组合框,程序运行后,为了输出选中的列表项,应使用的语句是()。
A. Print Cb1.Selected
B. Print Cb1.List(Cb1.Listlndex)
C. Print Cb1.Selected.Text
D. Print Cb1.List(Listlndex)
第8题
(16)窗体上有一个名称为Cbl的组合框,程序运行后,为了输出选中的列表项,应使用的语句是
A)Print Cb1.Selected
B)Print Cbl.I,ist(Cbl.ListIndex)
C)Print Cb1.Selected.Text
D)Print Cbl.List(Listlndex)
第9题
A.A.For循环的循环初值i应该从I开始
B.B.语句Comb01.Removeltemi有错误
C.C.语句Comb01.AddIteraComb01.Text有错,Comb01.Text的内容已存在于组合框中
D.D.应把程序倒数第3行中的Ifnag=1改为Ifflag=O
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!