因此,当用户单击组合框中的customersID时,我的组合框用于填充数据网格视图,它将弹出网格。我有填充代码,但问题是它们的组合框本身没有重置。它仍然显示已选择的当前值。我想知道在选定的索引事件后重置组合框是可行的。下面的代码是我如何得到我的组合框。
' after a command and connection was made
customerAdapt = New SqlDataAdapter(customerQuery,con)
customerSet = New DataSet
customerAdapt.Fill(customerSet)
customerCb.DataSource = adoAddtRs.tables(0)
customerCb.DisplayMember = "custID"
customerCb.ValueMember = "custID"
customerCb.Visible = False
customerCb.DropDownStyle = ComboBoxStyle.DropDownList
答案 0 :(得分:1)
尝试这段编码
customerCb.selectedindex = -1