A very easy way to show different string values than the Items is to set the Style property from csDropDown to csOwnerDrawFixed as Andreas Rejbrand has answered a few years ago.
The thing is: as soon as you do that, you loose Windows Theming support.
The same limitation applies to using csOwnerDrawVariable
These two Style values get translated into adding the CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE (in addition to CBS_DROPDOWNLIST) styles of the Windows COMBOBOX control.
In turn, CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE cause you to instantly loose the Windows theming support.
When you do full custom painting like a colour picker, that is all fine. But when you only want to replace the drawn text, it is not.
The Windows COMBOBOX control does not seem to have a way around this, so I'm wondering: how can you simulate the Windows theming from Delphi?
I assume it has to do with DrawThemedBackground, but it has been a while since I've done serious Delphi Control work, so any pointers on how to get started there are fine too (even if they invalidate my assumption).
Some links if people actually want to try this (you probably shouldn't as it is way too much work).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With