On 5/30/05, rockmoyosa <[EMAIL PROTECTED]> wrote:
> Does anybody how this is done. How Do I determin wat the height needs
> to be after I have set the text in it. I don't want any scrollbars but
> I do want to show everything in the textarea. So I need to know the
> height.

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
  xmlns="*">
  <mx:Script>
    public function adjustHeight():Void
    {
      t.height = t.label.textHeight + 4;
    }
  </mx:Script>
  <mx:Button label="Adjust Height" click="adjustHeight()"/>
  <mx:TextArea id="t" vScrollPolicy="off">
    <mx:text>The quick brown fox jumped over the wall, and the quick
brown fox jumped over the wall, and the quick brown fox jumped over
the wall, and the quick brown fox jumped over the wall, and the quick
brown fox jumped over the wall, and the quick brown fox jumped over
the wall, and the quick brown fox jumped over the wall, and the quick
brown fox jumped over the wall, ...</mx:text>
  </mx:TextArea>
</mx:Application>

Note: 'label' is an undocument variable inside the TextArea class. 
You're on your own.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to