S
S
sorry_i_noob2019-06-29 13:10:48
Delphi
sorry_i_noob, 2019-06-29 13:10:48

Is it possible to prevent non-existent Items from being selected in a ComboBox, but at the same time leave the ability to enter Items and not just select them?

Hello. I have in ComboBox, and it has a lot of Items, because of this it is inconvenient to select them. I want to make it possible to enter Items (so that there is auto-completion with the ability to select an existing Item), but at the same time prohibit non-existent Items (after all, you can enter anything - this is not a choice, but an input). How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2019-06-29
@tsklab

TComboBox.Style
csDropDownList : defines a drop-down list with no edit box; the user cannot enter text manually. All items are strings of the same height.
And jumps to the first character.
If you need to enter more than one character, but only select from a list, don't let it exit with TComboBoxif ComboBox1.ItemIndex < 0.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question