Combobox with SuggestAppend

Mar 8 2010 8:14 AM

Hi All,
I Have a combobox with AutoCompleteMode = SuggestAppend, AutocompleteSource = ListItems and DropDownStyle = Simple.
The problem that i'm having is that the user cannot select an item from the autocomplete list using the mouse. This will clear the textbox in stead of filling it with the selected item.
Using the arrow keys to select an item in the autocomplete list, and then hit Enter on the desired item, works fine, although i had to use a hack to accomplish this
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(msg.WParam.ToInt32() == (int)Keys.Enter)
{
SendKeys.Send("{Tab}");
return true;
}

return base.ProcessCmdKey(ref msg, keyData);
}
Now selecting an item with the left mouse also fires the SendKeys method, so it seems the Enter key and the Left mouse are threated the same way. Still, using the mouse, the selected item is not filled into the text portion of the combobox.