Discussion:
Combo box that changes as you type
(too old to reply)
Charlie Gibbs
2020-01-12 23:05:42 UTC
Permalink
I've written programs that use combo boxes to make a selection from
a list of values (style CBS_DROPDOWNLIST). They work quite well, but
I'm starting to envy the action shown by search engines, where as you
type a value, the drop-down list changes to consist only of values
containing the characters you've typed. I've tried changing the
style in one of my programs to CBS_DROPDOWN, which changes the
selected value to an edit box into which I can type whatever I
want - but the drop-down list doesn't change. Presumably I'll
have to do that myself, unless there's an option that I'm missing.
Are there any examples of working code I could look at?

aTdHvAaNnKcSe...
--
/~\ Charlie Gibbs | Microsoft is a dictatorship.
\ / <***@kltpzyxm.invalid> | Apple is a cult.
X I'm really at ac.dekanfrus | Linux is anarchy.
/ \ if you read it the right way. | Pick your poison.
JJ
2020-01-13 16:44:51 UTC
Permalink
Post by Charlie Gibbs
I've written programs that use combo boxes to make a selection from
a list of values (style CBS_DROPDOWNLIST). They work quite well, but
I'm starting to envy the action shown by search engines, where as you
type a value, the drop-down list changes to consist only of values
containing the characters you've typed. I've tried changing the
style in one of my programs to CBS_DROPDOWN, which changes the
selected value to an edit box into which I can type whatever I
want - but the drop-down list doesn't change. Presumably I'll
have to do that myself, unless there's an option that I'm missing.
Are there any examples of working code I could look at?
aTdHvAaNnKcSe...
Windows standard combobox's autocomplete is not as full featured as the one
in web pages. You'll have to implement it by yourself if you want such
feature.

The dropdown list of Windows standard combobox is a fixed list. So, to make
it dynamic based on what is typed into the combobox, you'll have to keep a
separate list which contains the whole items (call it main list). You need
to repopulate the combobox's list based on the combobox input each time the
combobox input changes, then show the dropdown list.
Charlie Gibbs
2020-01-13 20:00:39 UTC
Permalink
Post by JJ
Post by Charlie Gibbs
I've written programs that use combo boxes to make a selection from
a list of values (style CBS_DROPDOWNLIST). They work quite well, but
I'm starting to envy the action shown by search engines, where as you
type a value, the drop-down list changes to consist only of values
containing the characters you've typed. I've tried changing the
style in one of my programs to CBS_DROPDOWN, which changes the
selected value to an edit box into which I can type whatever I
want - but the drop-down list doesn't change. Presumably I'll
have to do that myself, unless there's an option that I'm missing.
Are there any examples of working code I could look at?
aTdHvAaNnKcSe...
Windows standard combobox's autocomplete is not as full featured as the one
in web pages. You'll have to implement it by yourself if you want such
feature.
The dropdown list of Windows standard combobox is a fixed list. So, to make
it dynamic based on what is typed into the combobox, you'll have to keep a
separate list which contains the whole items (call it main list). You need
to repopulate the combobox's list based on the combobox input each time the
combobox input changes, then show the dropdown list.
I suspected as much. I just wanted to make sure I wasn't missing something.
--
/~\ Charlie Gibbs | Microsoft is a dictatorship.
\ / <***@kltpzyxm.invalid> | Apple is a cult.
X I'm really at ac.dekanfrus | Linux is anarchy.
/ \ if you read it the right way. | Pick your poison.
JJ
2020-01-14 11:27:49 UTC
Permalink
Post by Charlie Gibbs
Post by JJ
Post by Charlie Gibbs
I've written programs that use combo boxes to make a selection from
a list of values (style CBS_DROPDOWNLIST). They work quite well, but
I'm starting to envy the action shown by search engines, where as you
type a value, the drop-down list changes to consist only of values
containing the characters you've typed. I've tried changing the
style in one of my programs to CBS_DROPDOWN, which changes the
selected value to an edit box into which I can type whatever I
want - but the drop-down list doesn't change. Presumably I'll
have to do that myself, unless there's an option that I'm missing.
Are there any examples of working code I could look at?
aTdHvAaNnKcSe...
Windows standard combobox's autocomplete is not as full featured as the one
in web pages. You'll have to implement it by yourself if you want such
feature.
The dropdown list of Windows standard combobox is a fixed list. So, to make
it dynamic based on what is typed into the combobox, you'll have to keep a
separate list which contains the whole items (call it main list). You need
to repopulate the combobox's list based on the combobox input each time the
combobox input changes, then show the dropdown list.
I suspected as much. I just wanted to make sure I wasn't missing something.
FYI, web pages are actually the same. Autocomplete dropdowns have to be
manually designed. i.e. it's not a built in feature.

While HTML do have the SELECT element which by default, is configured to
look and work like a combobox control, its input box can't be made editable
like a normal text input box where users can input a text which is not
already in the list. So, those autocomplete dropdown controls on web pages
are actually text-typed INPUT elements with a separate element (such as DIV)
to serve as the dynamic dropdown list.

Loading...