Page 1 of 1

Resize a field to the width of its contents

Posted: Fri Oct 03, 2014 5:47 pm
by andrewferguson
Hi,
I have a field and I need a way for it to resize its width to the the width of text that is in the field. The text in the field could be any length, but will not span over multiple lines.
Any ideas?
Andrew

Re: Resize a field to the width of its contents

Posted: Fri Oct 03, 2014 5:55 pm
by FourthWorld
See the formattedWidth property in the Dictionary, e.g.:
set the width of fld 1 to the formattedWidth of fld 1

Re: Resize a field to the width of its contents

Posted: Fri Oct 03, 2014 5:56 pm
by LCNeil
Hi Andrew,

Try the following-

Code: Select all

set the width of field "your field" to the formattedwidth of field "your field
Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--

*Richard beat me to it above :)

Re: Resize a field to the width of its contents

Posted: Fri Oct 03, 2014 6:08 pm
by andrewferguson
Thanks very much, this is exactly what I was looking for!
Andrew