use two members with equal widths, but w/their framing set differently.

member(1) = FIXED (framing)
  it goes on the Stage (= sprite(1) in my example code)
  set it's height to the maximum you want to allow for
member(2) = ADJUST TO FIT (framing)
  leave it in the cast

-- load the text to be tested into member(2)
-- grab it's height & see if the text will fit into the fixed sprite's height

   x = sprite(1).rect         -- sprite(1) uses member(1)
   useableHeight = x[4]-x[2]  -- calcs it's usable height (maximum allowable)

   y = member(2).rect


   if (useableHeight - y[4]) > 0 then
     -- then the text will fit, so loadup member(1)
     member(1).text = member(2).text
   end if

hth

-Buzz

At 10:55 AM -0400 4/11/02, you wrote:
>Hi.
>
>1 good question for all.
>
>I want to adjust the font size to fit text in a field (or textbox).
>
>The size of the textbox can not be change.
>
>I want the size to be the bigger as possible.
>
>I can calculate the number of char and adjust with this infos. ("if
>MyVar.chars.count > 80" then text.fontsize=12.
>
>But i guess there is a way much cool!
>
>Thanks for your infos
>
>FH
>
>__________________________________________________________
>L�che-vitrine ou l�che-�cran ?
>magasinage.yahoo.ca
>[To remove yourself from this list, or to change to digest mode, go 
>to http://www.penworks.com/lingo-l.cgi  To post messages to the 
>list, email [EMAIL PROTECTED]  (Problems, email 
>[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
>programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to