Help please - TTntComboBox

Please discuss general Delphi programming topics here.

Help please - TTntComboBox

Postby arnold123 » May 13th, 2011, 9:17 am

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
arnold123
Member
Member
 
Posts: 4
Joined: May 13th, 2011, 9:01 am

Re: Help please - TTntComboBox

Postby arnold123 » May 13th, 2011, 9:42 am

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
arnold123
Member
Member
 
Posts: 4
Joined: May 13th, 2011, 9:01 am

Re: Help please - TTntComboBox

Postby Kambiz » May 13th, 2011, 2:32 pm

Did you try to set AutoComplete and AutoCompleteDelay properties?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: Help please - TTntComboBox

Postby arnold123 » May 16th, 2011, 8:10 am

yes: Autocomplete - True; AutoCompleteDelay - 500;
arnold123
Member
Member
 
Posts: 4
Joined: May 13th, 2011, 9:01 am

Re: Help please - TTntComboBox

Postby Kambiz » May 18th, 2011, 9:59 pm

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: Help please - TTntComboBox

Postby arnold123 » May 19th, 2011, 8:53 am

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!
arnold123
Member
Member
 
Posts: 4
Joined: May 13th, 2011, 9:01 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron