• 0
  • 7
  • 0

ComboBox problem on Windows Mobile 6

Jul 30 2010 5:54 AM
Hi All,

Got a slight problem with a combobox on a WM6 touchscreen device, which is probably quite trivial, but I'm damned if I can get it to work. Just for the record I'm using VS2005 and .NetCF2.

I have a combobox on a form, populated with data. The user can either press the screen to drop down the combo and select an item, or they can use the cursorkeys and enter to select and item (combobox has focus once shown).

When using the cursorkeys the combo box doesn't drop down until Enter is pressed, and this is where my problem is.

I use the SelectedIndexChanged event to capture the selected text into a variable, I then use the form_Process method to capture the Enter key press and do what I need to do with it in there. If selected using the touch screen that's not a problem as the dropdown is fully drawn, but if I use the Enter key, the dropdown gets partially drawn and looks a bit of a mess.

So, what I'd like to do, is when the user is using the keyboard to navigate the combo, that the dropdown is never called when enter is pressed as the user has made his selection.

I've tried capturing the key events, but it starts to draw the combo before the KeyDown event occurs.

Any suggestions would be really useful.


Answers (1)