单选题
VB
题号 #484338
在窗体上画一个列表框和一个命令按钮,其名称分别为List1和Command1,然后编写如下事件过程:
Private Sub Form_Load()
List 1.Addltem“Item 1”
List1.Addltem“Item 2 ”
List1.AddItem“Item 3”
End Sub
Private Sub Command1_Click()
List1.List(List1.ListCount)=“AAA”
End Sub
程序运行后,单击命令按钮,其结果为( )
参考答案
B
答案解析
在窗体的Load事件中,依次向列表框中加入“Item 1”、 “Item 2”、 “Item 3”。列表框的ListCount属性表示列表框中表项的数量,列表框中的表项的排列从0开始,最后一项的序号为ListCount_1;列表框的List属性用来列出表项的内容。List1.List(Listl.ListCount)=“AAAA”的作用是:在列表的末尾添加一新的表项,其值为“AAAA”,所以,答案是B。
你可能感兴趣的试题
A.Private Sub Text1_Change()
Command1.Caption=“算机等级考试”
End Sub
Command1.Caption=“算机等级考试”
End Sub
B.Private Sub Command1_Click()
Caption=“计算机等级考试”
End Sub
Caption=“计算机等级考试”
End Sub
C.Private Sub Form_Click()
Text1.Caption=“计算机等级考试”
End Sub
Text1.Caption=“计算机等级考试”
End Sub
D.Private Sub Command1_Click()
Text1.Text=“计算机等级考试”
End Sub
Text1.Text=“计算机等级考试”
End Sub
A.Command 1.Move-200
B.Command 1.Move 200
C.Command 1.Left=Command1.Left+200
D.Command 1.Left=Command1.Left-200
A.Enabled=True
B.Enabled=False
C.Visible=True
D.Visible=False