计算机二级VB:这道题的答案是怎么得出来的?要过程。
2014-03-27
展开全部
Private Sub form_load()
List1.AddItem "a0001"
End Sub
Private Sub command1_click()
t = 0
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
If Text1.Text = List1.Text Then
t = 1
MsgBox "不能输入重复项,请重新输入"
Text1.Text = ""
Exit For
End If
Next i
If t = 0 Then List1.AddItem Text1.Text
Text1.Text = ""
End Sub
List1.AddItem "a0001"
End Sub
Private Sub command1_click()
t = 0
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
If Text1.Text = List1.Text Then
t = 1
MsgBox "不能输入重复项,请重新输入"
Text1.Text = ""
Exit For
End If
Next i
If t = 0 Then List1.AddItem Text1.Text
Text1.Text = ""
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询