Combobox with autocomplete

D

Dom

I like the control "Combobox" with the Autocomplete property set to
true. For those of you unfamiliar with it, the control consists of a
text box with a list box under it. As you type in the text box, the
autocomplete appends to what you have typed, giving you the first item
in the listbox that matches.

One problem. If you type <CR>, (which is what most people would type
in order to accept the autocompleted text) the text box goes blank, so
the user loses everything. Why, I don't know.

I tried to work around it, by capturing the KeyDown event, but
unfortunately, in this control, if the key is a <CR> the event is not
raised until after the Text has changed.

Anyone know a work around?

Dom
 
D

Dom

I like the control "Combobox" with the Autocomplete property set to
true.  For those of you unfamiliar with it, the control consists of a
text box with a list box under it.  As you type in the text box, the
autocomplete appends to what you have typed, giving you the first item
in the listbox that matches.

One problem.  If you type <CR>, (which is what most people would type
in order to accept the autocompleted text) the text box goes blank, so
the user loses everything.  Why, I don't know.

I tried to work around it, by capturing the KeyDown event, but
unfortunately, in this control, if the key is a <CR> the event is not
raised until after the Text has changed.

Anyone know a work around?

Dom

2 minutes after I wrote this post, I decided to write a user-control
called MyComboBox that had the features I wanted. Took me about 5
minutes. So I guess I should withdraw this question, but all the
same, does anyone know the answer? It seems to me that one feature
makes the "Autocomplete" Property pretty useless.

Dom
 
Z

zacks

I like the control "Combobox" with the Autocomplete property set to
true.  For those of you unfamiliar with it, the control consists of a
text box with a list box under it.  As you type in the text box, the
autocomplete appends to what you have typed, giving you the first item
in the listbox that matches.

One problem.  If you type <CR>, (which is what most people would type
in order to accept the autocompleted text) the text box goes blank, so
the user loses everything.  Why, I don't know.

I tried to work around it, by capturing the KeyDown event, but
unfortunately, in this control, if the key is a <CR> the event is not
raised until after the Text has changed.

Anyone know a work around?

Dom

What happens if you TAB out of the field?
 
D

Dom

What happens if you TAB out of the field?- Hide quoted text -

- Show quoted text -

Now that you mention it, TAB works the way CR should. It completes
the autocompleted text. But this is not obvious to the users, who
will always use CR instead.

In any case, like I said, I created a User Control that does what I
want.
 
K

Ken Foskey

Now that you mention it, TAB works the way CR should. It completes the
autocompleted text. But this is not obvious to the users, who will
always use CR instead.

Your text box is not multiline is it? In which case the cr would give
you a new line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top