Sizing a FTC based on content size

  • From: Ron Benditt <rbenditt@xxxxxxxxxxxxxxxxxx>
  • To: ftcdev@xxxxxxxxxxxxx
  • Date: Sat, 23 May 2009 12:03:32 -0700

Hello Brendan,

I know we discussed this subject briefly many months ago... but now  
I'm hot into getting it to work this time!  I'm trying to put RTF into  
an FTEditField, and then set the height of the FTEditField to match  
the size of the contents.  So I'm doing this:

       eField.setRTF(s)

       TextHeight=eField.getDoc.getPageHeightLength

       If TextHeight<38 Then
         TextHeight=38
       End If

       eField.Height=TextHeight
       eField.resize

What I'm finding is that I often get an unreliable TextHeight back  
from the getPageHeightLength function.  I found that the FTEditField  
appears to recalculate itself many times and eventually it arrives at  
the correct number.  So if I were to set the RTF and then do the  
adjusting in a timer that fires 2 seconds later, it works correctly  
every time.  But if I try to adjust things as I show above, it is  
usually wrong.  Is there some sort of update that I can call between  
setting the RTF and calling the getPageHeightLength method?

Thanks,

Ron Benditt
Alien Apparatus Company, Inc.
http://www.alienapparatus.com


FTC Website: http://www.truenorthsoftware.com/formattedtextcontrol
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.



Other related posts: