1

There is a window appear after you click that triangle icon of ComboBox. This I know it's not just a panel like object because for example in the following picture it' out of main form.

What is its type and how can I create something like this?

enter image description here

Community
  • 1
  • 1
SAMPro
  • 1,068
  • 1
  • 15
  • 39

1 Answers1

8

It is a standard ListBox control that the ComboBox creates internally (its HWND is accessible via the CB_GETCOMBOBOXINFO message). It is implemented as a free-floating window (so it can appear outside the ComboBox's parent window), except when the Style property is set to csSimple, in which case the ListBox resides as a child within the ComboBox's client area instead.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • The free-floating window is a form? How can I create something like that? – SAMPro Feb 17 '15 at 05:01
  • It's not a form. It's not a Delphi control. It's a Win32 listbox. – David Heffernan Feb 17 '15 at 07:40
  • 2
    In the Win32 api, just about any windowed control can be free-floating with the right flags applied not just forms. But in VCL, only forms are floating. – Remy Lebeau Feb 17 '15 at 08:10
  • It is not exactly a standard listbox. It should at least have been modified a bit for it's actually a [`ComboLBox`](https://msdn.microsoft.com/en-us/library/ms633574(v=vs.85).aspx#system). – Sertac Akyuz Feb 17 '15 at 21:06
  • My guess is that Microsoft simply derived `ComboLBox` from `ListBox` to add the extra ComboBox logic to it. But it is still more-or-less a standard ListBox in general. You can send standard ListBox messages directly to the list's HWND. – Remy Lebeau Feb 17 '15 at 21:38