Question

I'm trying to make a combo box that behaves somewhat like the Firefox 3 Awesomebar, with the following behavior:

  1. Type in text
  2. Asynchronously bring back results
  3. Up and down selects results in the list, BUT leaves the text that was typed in the entry box so the user can continue editing to limit the resultset differently
  4. Enter fires an event that the parent form will handle

I have the asynchronous results and filtering all working, but I don't have a good method for displaying and selecting within the results.

A combo box automatically fills the entry box with what is selected when you arrow down. Fails #3.

I've got the DevExpress controls, but their combo box does the same thing and I can't figure out how to override either.

A LookupEdit does not allow typing arbitrary stuff. Neither does a PopupContainerEdit.

I want behavior that's like a textbox with a listbox below it, and up/down events in the textbox get passed to the listbox. But if I try to make a custom control that combines the two like that, I have no clue how to "float" the listbox like the dropdown on a normal combo box.

Clues much appreciated!

Was it helpful?

Solution

You may need to use a textbox instead of a combo box because using the arrow keys is selecting values from the combos list and overwriting your current value. By using the textbox you can do you lookup in the TextChanged event and you can store the currently typed value by overriding the KeyPress event to collect and store the keys the user has typed.
You popup list of values would have to be self drawn in the paint event.

This may seem overly complicated but you probably need to drop the combo control and implement some of its functions yourself.

OTHER TIPS

I've been using the AutoComplete control from Skybound. It's free. It can be customized, so that it can approximate the behavior from the Awesomebar.

http://dev.skybound.ca/Products/AutoComplete/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top