Combobox dropdown problem
I have a problem with combobox dropdown. When the dropdown opens, if I want to move focus to another control (say a textbox), I need to double-click, because the first click closes the combo dropdown, and then the second click closes the textbox. How do I fix this? Please, help.
You can listen to the event DropDownList.SelectedIndexChanged
, and in the event handler, set focus to the next control by setting TextBox.Focus()
or callingSystem.Windows.Forms.Control.SelectNextControl()
I think this would be "non-standard" behavior for what it's worth. It's quite normal to expect the user to insert a tab or select the next control after using the dropdown.
Edit: Sorry, in WPF ComboBox an equivalent event SelectionChanged
, but when reflecting, it's better to use . This would mean that you only move focus after using the dropdown, not just when the value changes. OnDropDownClosed
source to share