I have a combobox that once you enter the control, sets the .DroppedDown property to True so it will expand the box to show the contents. Then a user can start typing stuff in and it will scroll to any matches in the box. From there I want the user to be able to hit the ENTER key and the top item be "selected."
I've tried doing this and it appears to be working; however, I only sets the .Text property to whatever the top item is and doesn't actually affect the .SelectedText or .SelectedValue (which is ultimately what I care about).
So what this means is that in order for the top shown item to be "selected" I have to hit the DOWN ARROW and then ENTER for it to process the selection change and modify the appropriate properties.
Any ideas on how I can eliminate the DOWN ARROW step? I have not overridden the combobox keypress eventhandler in anyway. Here's the Handler I have for it:
Private Sub cbo_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cboFrom.KeyDown, cboTo.KeyDown
Dim cbo As ComboBox = CType(sender, ComboBox)
If e.KeyCode = Keys.Enter Then
cbo.DroppedDown = False
If cbo.Name = "cboFrom" Then cboTo.Focus() 'Move the focus to the next object
If cbo.Name = "cboTo" Then txtAmount.Focus() 'Move the focus to the next object
If cbo.DroppedDown = False Then
cbo.DroppedDown = True
Thank you in advance.