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
Resize a field to the width of its contents
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 184
- Joined: Wed Apr 10, 2013 5:09 pm
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Resize a field to the width of its contents
See the formattedWidth property in the Dictionary, e.g.:
set the width of fld 1 to the formattedWidth of fld 1
set the width of fld 1 to the formattedWidth of fld 1
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Resize a field to the width of its contents
Hi Andrew,
Try the following-
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--
*Richard beat me to it above
Try the following-
Code: Select all
set the width of field "your field" to the formattedwidth of field "your field
Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--
*Richard beat me to it above

-
- VIP Livecode Opensource Backer
- Posts: 184
- Joined: Wed Apr 10, 2013 5:09 pm
Re: Resize a field to the width of its contents
Thanks very much, this is exactly what I was looking for!
Andrew
Andrew