Cannot get flat TRzCombobox

Viewing 3 reply threads
  • Author
    Posts
    • #1545
      Olivier Beltrami
      Participant

        Hi,

        Under Windows 7, Delphi 10.3.2, I am trying to get a flat TRzComboBox with the Style set to csDropDownList, but what I get is a big bumpy 3-D button-like control.

        If I set Style to csDropDownList, then I get a flat look, as desired but the control gets focus and users can type in it (which I do not want). I tried to set AllowEdit to false, but it did not seem to do anything. I tried to set ReadOnly to true, but then the dropdown button disappears and, contrary to the TRzButtonEdit, there seems to be no option to show the button when in readonly mode.

        I just want a flat csDropDownList, but I cannot seem to find a way to do it.

        Very best regards,

        Olivier

      • #1546
        Ray Konopka
        Keymaster

          The button appearance is thanks to Microsoft and the way csDropDownList combo boxes are displayed on Windows 7. Thankfully, they changed the appearance for Windows 8 and 10, but that does not help you. (Although you probably should upgrade Windows soon).

          Anyway, setting the Style to csDropDown and setting the AllowEdit property to True is the recommended alternative. The AllowEdit property does NOT prevent the user from typing into the control, but it does prevent the user from entering in text that does not appear in the drop down list. This way, the incremental searching functionality still works in the control, but the user cannot enter in a new value that is not in the drop down list.

          Ray

        • #1553
          Olivier Beltrami
          Participant

            Hi Ray,

            Thank you very much for your prompt and detailed response.

            Yes, I will change my last development PC to Windows 10, when time permits, but I still have a lot of users on windows 7, so I still want my software to look the way I want on it :-).

            Looking at the TRzComboBox, with the Style set to csDropDownList, again, I guess my only complaint is the rounded-3d look. I tried to look at the source code to see if it could be disabled, but did not succeed. Is it possible to get rid of that roundness ?

            Very best regards,

            Olivier

          • #1556
            Ray Konopka
            Keymaster

              Unfortunately, the appearance of the combo box is controlled by the visual style of the control via Windows. The control does change its appearance if VCL Styles are used because the VCL Style defines a new style for the elements of the combo box. So, if you are using VCL Styles, then you could get a custom looking combo box. It would be nice if you could apply a VCL Style to jus a single control, but that is not possible.

              Ray

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