Page 1 of 1

Help please - TTntComboBox

PostPosted: May 13th, 2011, 9:17 am
by arnold123
hello,
I'm using a TTntComboBox in Delphi with csDropDownList style. It has a large list of elements (example AA, AB, AC, BB, BC, DA, ...)

Please help me with the following issue: when pressing a key, the TTntComboBox should drop down and select the item that starts with the pressed key; if you press that key again, it selects the next item and so on

example: you press B, combobox opens and you have BB selected; you press B again and you have BC selected; you press B again and it returns to BB element

example 2: you press C, nothing happens because there isn't anything that starts with C

I tried to get trough the items of the combobox while keypressed and open the combobox if finding something + selecting it, but didn't have much success

Best regards

Re: Help please - TTntComboBox

PostPosted: May 13th, 2011, 9:42 am
by arnold123
And, some extra details.. if you got longer texts like aaaaab aaaac, aaaad, abbb, abcc, abdcc, accc, accd:

If you type abc, it selects you the abcc element (items are sorted)

This was working with csDropDown, but i need csDropDownList

Thanks in advance and best regards

Re: Help please - TTntComboBox

PostPosted: May 13th, 2011, 2:32 pm
by Kambiz
Did you try to set AutoComplete and AutoCompleteDelay properties?

Re: Help please - TTntComboBox

PostPosted: May 16th, 2011, 8:10 am
by arnold123
yes: Autocomplete - True; AutoCompleteDelay - 500;

Re: Help please - TTntComboBox

PostPosted: May 18th, 2011, 9:59 pm
by Kambiz
In Delphi 7, I dropped a TTntComboBox control on a form, then set Style property to csDropDownList and Items property to some random text, keeping other properties with their default values.

The control responded to the key presses as expected. Even changing AutoComplete property to false, didn't disable the first match selection behavior. However, to open the drop down list while pressing keys, both AutoDropDown and AutoComplete properties must be true.

Re: Help please - TTntComboBox

PostPosted: May 19th, 2011, 8:53 am
by arnold123
there was a KeyPress event handler that was improving functionality of csDropDown, but messing with the functionality of csDropDownList; handler was edited and now everything works well for csDropDownList

thanks a lot for your time and have a great day forwards!