Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › TRZComboBox: Using AutoComplete.
- This topic has 3 replies, 2 voices, and was last updated 2021-03-04 at 12:57 am by Ray Konopka.
-
AuthorPosts
-
-
February 25, 2021 at 4:44 pm #2384
Hi Ray,
I have a TRzComboBox with a list of names: John Anderson, John Brown, John Smith.
If I type a new name into the list, eg. “John Jones”, it works fine.
However, if I just type “John” into the list (with no surname) it automatically selects the first closest match, which in this case is “John Andrerson”.
If I just type “John”, and when it selects “John Anderson”, then delete the “Anderson” part leaving just “John”, as soon as I exit the TRzComboBox it will select “John Anderson” again. Is there any way to prevent this happening so that just “John” is shown?
Thanks,
Steve
-
February 25, 2021 at 11:25 pm #2386
Hi Steve,
I tried to duplicate what you described by doing the following:
1. Create new VCL Application (btw, I’m using Delphi 10.4)
2. Drop a TRzComboBox and a TRzEdit onto the form.
3. Edit the Items of RzComboBox1 and add the three “John” names plus a couple others.
4. I then ran the application.
5. I typed “John” without the quotes into the combo box and “John Anderson” get displayed with the ” Anderson” highlighted.
6. I then pressed the Delete key to delete the selected text.
7. I then pressed the Tab key to switch to the RzEdit1.
8. The combo box still showed just “John”.Do you have any other event handlers on the combo box that could be causing the behavior you are seeing?
Ray
-
February 26, 2021 at 11:37 pm #2391
Hi Ray,
I discovered that if AutoDropDown is set to True, then it displays the behaviour I described.
Thanks,
Steve
-
March 4, 2021 at 12:57 am #2398
Ah, I see. Interesting. The drop down is causing a focus change and that is repopulating the content area. Unfortunately, the code would need to be modified in order to change this behavior, and even then I’m not sure it would be possible to change this behavior. The same thing happens with the standard TComboBox–it may be intrinsic to the combo box Windows control. Hopefully, turning off AutoDropDown will be sufficient.
Ray
-
-
AuthorPosts
- You must be logged in to reply to this topic.