2 Replies Latest reply on Apr 18, 2007 7:34 AM by romanczar

    Combobox with colored entries

    romanczar
      Hi!
      How can I write a Combobox itemrenderer that allows me to set the items background color according to its label value?

      Any ideas?
        • 1. Re: Combobox with colored entries
          romanczar Level 1
          Hi!

          I tried some MXML and AS ItemRenderers. I simply extended the mx:Canvas or mx:VBox and placed mx:Text or mx:Label inside. This worked more or less....

          I could set the backgroundColor property of the canvas as I wanted to, BUT:

          There seems to be some sort of padding between the actual borders or the item in the dropdown and its itemrenderer. This has the effect that my e.g. red Canvas gets a gray border (left and right it is thicker than top and bottom.

          I can not get rid of that?

          Has anybody an idea? DO I need to extend another control or class?

          Help is highly appreciated :-)
          • 2. Re: Combobox with colored entries
            romanczar Level 1
            I played around some more an tried to extend ListItemRenderer. But still no success.

            hasn't anyone ever colored the BG of a ComboBox in different colors with respect to their content?