问题 单项选择题

在窗体上画一个名称为List1的列表框,一个名称为Label1的标签,列表框中显示若干城市的名称。当单击列表框中的某个城市名时,该城市名从列表框中消失,并在标签中显示出来。下列能正确实现上述操作的程序是______。

A.Private Sub List1_Click()Label1.Caption=List1.ListIndex List1.RemoveItem List1.Text End Sub

B.Private Sub List1_Click() Label1.Name=List1.ListIndex List1.RemoveItem List1.Text End Sub

C.Private Sub List1_Click() Label1.Cavtion=List1.Text List1.RemoveItem List1.ListIndex End Sub

D.Private Sub List1_Click() Label1.Name=List1.Text List1.RemoveItem List1.ListIndex End Sub

答案

参考答案:C

解析:[评析] List控件中ListIndex属性表示当前选中项目的索引,Text属性表示当前选中项目的内容,RemoveItern方法表示删除列表项;Label控件的Name属性表示控件的名称,Caption属性表示Label控件显示的内容。

多项选择题
问答题 简答题