0 Replies Latest reply on Apr 10, 2008 5:12 AM by Govindaram

    Resizable TextArea

    Govindaram
      I want to expand TextArea components height when the text in the
      TextArea is more than the default height. I already read about few
      successions like below:

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[
      import mx.events.FlexEvent;

      public function update():void
      {
      src.explicitHeight = src.textHeight + 10;
      }

      ]]>
      </mx:Script>
      <mx:Panel title="TextArea Control Example" height="75%"
      width="75%" paddingTop="10" paddingLeft="10">

      <mx:TextArea id="src" text="Hello" change="update()"/>

      </mx:Panel>
      </mx:Application>

      The above example increase the height of the TextArea for ANY CHANGE
      in the TextArea content. But I want to increase the height only when
      height of the content increases the height of the TextArea.

      How to achieve this required.
      Is there any way to count number of return character in the text?