Combo Box
-
Hi, I hv an application that need user to key in value for 2 text box. After that i will bind data to combo box based on the values of text boxes. However, i don't hv a button to trigger that binding process. I want to perform this process in combo box click event. But i hv to click the combo box twice. How to make user only click combo box once and then the value will directly pop out in combo box?:confused: Private Sub cbSubconRoute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSubconRoute.Click If (txtN.Text = "" Or txtC.Text = "") Then lblTxnStatus.Text = "Please Key In NSID And NSSPEC!" Return End If If (cbSubconRoute.Items.Count < 1) Then bindDataForComboBox() End If End Sub Private Sub bindDataForComboBox() cbSubconRoute.Items.Add("") cbSubconRoute.Items.Add(txtN.Text) cbSubconRoute.Items.Add(txtC.Text) cbSubconRoute.Refresh() End Sub
-
Hi, I hv an application that need user to key in value for 2 text box. After that i will bind data to combo box based on the values of text boxes. However, i don't hv a button to trigger that binding process. I want to perform this process in combo box click event. But i hv to click the combo box twice. How to make user only click combo box once and then the value will directly pop out in combo box?:confused: Private Sub cbSubconRoute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSubconRoute.Click If (txtN.Text = "" Or txtC.Text = "") Then lblTxnStatus.Text = "Please Key In NSID And NSSPEC!" Return End If If (cbSubconRoute.Items.Count < 1) Then bindDataForComboBox() End If End Sub Private Sub bindDataForComboBox() cbSubconRoute.Items.Add("") cbSubconRoute.Items.Add(txtN.Text) cbSubconRoute.Items.Add(txtC.Text) cbSubconRoute.Refresh() End Sub
I don't think you're not going to be able to do it that way. Why not add an event to the text boxes that checks if they both have text in and populate the combo box then? or maybe populate the text box on the Mouse_over event of the combo box?
Beware the chickens, for in their silence, they plot... Life is too short to be taken seriously. -- Oscar Wilde