每当我运行它并将组合框添加到组合框中并单击组合框后,框中的数据只会繁殖自己,任何帮助...这是我的代码
Private Sub productcombobox_Click(sender As Object, e As EventArgs) Handles productcombobox.Click
productcombobox.Items.Add("Manage Product")
productcombobox.Items.Add("Add Product")
End Sub
您可以在将数据添加到组合框之前添加clear()方法
Private Sub productcombobox_Click(sender As Object, e As EventArgs) Handles productcombobox.Click
productcombobox.Clear()
productcombobox.Items.Add("Manage Product")
productcombobox.Items.Add("Add Product")
End Sub
这是你的代码,所以只需在其他事情之前添加Clear()方法。
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
productcombobox.Items.Add("Manage Product")
productcombobox.Items.Add("Add Product")
End Sub
考虑到已发布的评论,不需要进行讨论。