在vb中,如何通过一个按钮把一个文本框的内容添加列表框中时,但是列表框中的内容不重复
2个回答
展开全部
Private Sub Command1_Click()
Dim A, K
A = Text1.Text
For x = 0 To List1.ListCount - 1
If List1.List(x) = A Then
K = 1
End If
Next
If K = 0 Then List1.AddItem A
End Sub
Dim A, K
A = Text1.Text
For x = 0 To List1.ListCount - 1
If List1.List(x) = A Then
K = 1
End If
Next
If K = 0 Then List1.AddItem A
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询