Label width by content

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
ahj_dk
Posts: 20
Joined: Wed Mar 09, 2016 9:10 pm

Label width by content

Post by ahj_dk » Wed May 25, 2016 11:06 pm

Hi,

Is it possible to scale a labels width to the content ?

I need a label to show different status messages, like "error adding to basket", "qty not a number" and so on.

I could add multiple labels where I set the caption and a fixed width, and show/hide these, but it would be easier if one label could be resized.
Regards
Allan Jakobsen
Futura Data A/S

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Label width by content

Post by Stewart Marshall » Thu May 26, 2016 8:59 am

Hi Allan

VL has never had content sizing. It has always been the case that the defined bounds of a control, i.e. it's Width and Height properties, define its size, and the content is therefore squashed to fit.

However, the GOOD NEWS is that as of 14 SP1, Table Layout has been enhanced to support content sizing. It is now possible for a control, e.g. Label, Button, Panel, and even a List, to grown to accommodate the content. Thus, as a caption for a button changes, it can get wider. If there are other controls flowing based on the first button, they will move. Similarly, a list can get longer as items are added, making the whole page longer.

Effectively, VL now offers the best of both sizing models, and of course, this is all visible at design time.

SP1 development will finish very soon, so you can expect it in the next couple of months or so...hopefully.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Post Reply