TRZComboBox: Using AutoComplete.

Home Forums Konopka Signature VCL Controls (formerly Raize Components) TRZComboBox: Using AutoComplete.

Viewing 3 reply threads
  • Author
    Posts
    • #2384
      Steve Gill
      Participant

        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

         

      • #2386
        Ray Konopka
        Keymaster

          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

        • #2391
          Steve Gill
          Participant

            Hi Ray,

            I discovered that if AutoDropDown is set to True, then it displays the behaviour I described.

            Thanks,

            Steve

          • #2398
            Ray Konopka
            Keymaster

              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

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.