单选题
在窗体上画三个名称分别为Text1、List1和Command1的文本框、列表框和命令按钮,且List1中有若干列表项,Text1的内容为空,然后编写如下事件过程:
Private Sub Command1_Click()
Dim i As Integer
If Text1.Text=""Then
Exit Sub
End If
If List1.ListIndex< >一1 Then
List1.List(List1.ListIndex)=Text1.Text
Else
List1.Addhem Text1.Text
End If
Text1.Text=""
End Sub
以下叙述中正确的是( )。