全部题库 / VB / 试题详情
单选题 VB
2008-03-18

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

A.Privale Sub List1_Click()
   Label1.Caption=List1. ListIndex
   List1.Removeltem 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.Caption=List1.Text
   List1.RemovItem List1.ListIndex
  End Sub
D.Private Sub List1_Click()   
   Label1.Name=List1. Text   
   List1.RemoveItem List1. ListIndex   
  End Sub

参考答案

C

答案解析

列表框的Text属性值为最后一次选中的表项的文本;列表框的List InDex属性是已选中的表项的位置。

你可能感兴趣的试题