Hi,
First : thanks for responses.
I have a form with a lot of input fields (text and combo boxes). I want
that filling these fields be easy and quick for user. So if it navigates
through controls with the tab key, when he arrives on a combo box, i
want to automatically open the combo box. For this I created a handler
for the Enter event, as it :
private void cb_Enter(object sender, EventArgs e)
{
ComboBox cb = (ComboBox)sender;
if (cb.SelectionIndex == -1) cb.DroppedDown = true;
}
This works fine when the user uses the tab key; but when he clicks with
the mouse, then the combo box is opened and closed immediatly : I will
want to prevent this.
Fred
Jani Järvinen [MVP] wrote:
Hi Fred,
>>I will want to do an action only if the combo box received focus after a
tab key press.
You can use the solution that Kevin has given. However, I started to think
your application and the requirement you have, as to me it fights against
the normal Windows user interface conventions.
What kind of activity would you want to do when the user presses the Tab key
to move to another control instead of using for example the mouse? How about
the Alt hotkeys that you can assign to a label control?