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.
Label width by content
Label width by content
Regards
Allan Jakobsen
Futura Data A/S
Allan Jakobsen
Futura Data A/S
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Label width by content
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.
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.