At button click on my form I have the code;
Private Sub BtnChk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnChk.Click
CmbTruckTyp.SelectedItem = CmbTruckTyp.FindStringExact(TxtTruckTyp.Text)
And the combo box at selectedindex change;
So what I am trying to do is when the button is clicked the combobox (CmbTruckTyp) is refreshed, then at the same time the previous selected item is focussed. This should be achieved by reading the value on the textbox (TxtTruckTyp.Text).
Private Sub CmbTruckTyp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbTruckTyp.SelectedIndexChanged
TxtTruckTyp.Text = CmbTruckTyp.Text
Now, the problem is when I click the button, the textbox becomes BLANK and the combobox refreshes without selected the previous selecteditem.
makes the TxtTruckTyp.Text to be empty. Why? Shouldn't this line of code ONLY update the combobox dropdownlist?