I'm trying to have a TComboBox with images instead of text. Is this possible? If yes, then how? I've looked over all of the properties a dozen times and I can't find anything. Also, I'm very new to Delphi. So maybe this is obvious, but I couldn't find a place to add images into a ComboBox instead of text. How can I add images to my ComboBox?
I tried looking online for help, but nothing really helped or nothing that was easy enough for me to understand.
For
TComboBox
, you can set itsStyle
property to one of theOwnerDraw
options, and then use itsOnDrawItem
event to draw your images.Or, as Andreas Rejbrand mentioned, you can use
TComboBoxEx
instead. Put your images in anImageList
assigned to itsImages
property, and then assign anImageIndex
to each item in itsItemsEx
property.