views:

484

answers:

1

Hi all,

I have a problem regarding combobox dropdown. Once a dropdown is opened, if I want to move focus to other control (say a textbox), I need to click twice because on first click, the combo dropdown is closed and then on second click, the textbox gets focus. How should I fix this? Please help.

A: 

You could listen to the DropDownList.SelectedIndexChanged event, and in the event handler set focus to the next control, either by setting TextBox.Focus(), or by calling System.Windows.Forms.Control.SelectNextControl()

I think this would be 'non standard' behaviour for what its worth. Its quite normal to expect the user to tab or select the next control after using a drop down.

Edit: Sorry, in a WPF ComboBox the equivalent event is SelectionChanged, but on reflection you'd be better using OnDropDownClosed. This would mean you only move the focus specifically after using the drop down rather than just whenever the value changes.

PaulG
Thanks for the reply..Is this event for Windows Forms combo??? I'm using WPF combobox..
Updated answer.
PaulG
But on dropdown close event, how should I know it is fired by clicking on other control?? It will close when you click on togglebutton in combo and even worst is that, my combo is filtering combo. So after filtering,the dropdown may open or close depends on filtered items.