2 Replies Latest reply on Aug 25, 2008 7:28 PM by atta707

    Change the background of a text control

    charger
      Hi,

      Anyone know of a way to change the background color of a text control in flex 3?
      (I've tried HTML tags in htmlText prop, subclassing the text control and setting backgroundColor prop to no avail)

      Thanks

      M
        • 1. Re: Change the background of a text control
          Level 7
          Try setting the opaqueBackground property on it to true.

          HTH;

          Amy

          "charger" <webforumsuser@macromedia.com> wrote in message
          news:g8ute8$n0p$1@forums.macromedia.com...
          > Hi,
          >
          > Anyone know of a way to change the background color of a text control in
          > flex
          > 3?
          > (I've tried HTML tags in htmlText prop, subclassing the text control and
          > setting backgroundColor prop to no avail)
          >
          > Thanks
          >
          > M
          >


          • 2. Re: Change the background of a text control
            atta707 Level 2
            Okay, it may get ugly!

            Text controls extends the Label control with has a protected member named textField of IUITextField. The object type created for IUITextField interface is UITextField which in turn has backgroundColor property! Mind you, it's not a style, but a property.

            So if you subclass Text class and get the textField member and try to set its backgroundColor property, it *should* work!

            Off the top of my head only!

            ATTA