I’m working on VS 2010 with VB using .NET Framework 4.0
I have a combobox. It has some items in it and displays just fine. Here’s where it gets a little weird:
If I click the drop-down arrow on the combobox and CLICK on the item I want, SelectedIndexChanged is called – good.
If I click inside the text area of the combobox and start typing what I want selected and finish it by pressing the up (or down) key, SelectedIndexChanged is called – also good.
If I click the drop-down arrow on the combobox and start typing what I want selected and finish it by pressing ENTER, SelectedIndexChanged is not called – PROBLEM.
Is there a different event that is caused by the ENTER in the last case? I’ve tried using the TextChanged and TextUpdate events, but those do not seem to be working:
Private Sub cmbStatus_TextChanged(sender As System.Object, e As System.EventArgs) Handles cmbStatus.TextChanged
If e.Equals(Keys.Enter) Then
Call SomeMethod()
End If
Should I use something besides e.Equals(Keys.Enter)?
Is there another event I should be looking for?
EDIT:
An example of the items in the ComboBox are:
- 10 – NEW ENTRY AND COMPLETENESS CHECK
---> this is the most common type - 13 – ASSIGNED TO TRB/HRB
---> there are a few with '/' - 60 – EXTERNAL (HOLD UNTIL FURTHER NOTICE)
---> there are a few with '(' and ')'
Basically, the type of each listing is “## – SOME TEXT”.
1 Answer