Is there anyway to get the UltraLabel to act like the regular WinForms Label with respect to autosizing? The scenario is a label inside a flow panel set to vertical. The windows label when set to autosize will expand to fill the width, and then wrap the text. The ultralabel will simply expand the width to go beyond the flow panel and not wrap. I've tried inheriting from UltraLabel and setting the protected property AutoSizeHeightOnly to true, but to no avail.
Thanks,
Jason
Hi Jason,
Returning true from AutoSizeHeightOnly should do it. But this will only affect the autosizing of the label itself, it doesn't affect the Flow Panel's autosizing.
I guess my problem is that the windows forms label when set to autosize and wrap, takes into account the size of the parent container when resizing while the UltraLabel doesn't care and will simply make the label as wide as it needs to when set to autosize.I guess I wouldn't have a problem with that except that since the label will expand the width, the TextTrimming preferences never come into play because there's always enough room for the text.
The other problem with setting AutoSizeHeightOnly is that it doesn't allow anything to set the width of the control (Like if it's in an ultragridbag and set to fill horizontally, that doesn't work).
Here's what I'm trying to accomplish (maybe it'll help):
We are displaying some summary information, one piece of information per line, done using UltraLabels. The information is contained within another control (currently a Panel with a FlowLayoutManager attached, but I've tried an UltraGridBag). I want a piece of information to take up the entire width of the container and if it does not fit, I want it to trim the text with ellipsis. I want the height to auto size because the labels will be restyled later and will probably be in a taller font.
Any suggestions? Thanks in advance.
If you are overriding AutoSizeHeightOnly and you are unable to set the Width of the control, then something is wrong. That sounds like a bug to me. But I'm not sure how that could possibly be the case - someone has to set the width at some point.
Perhaps you should create a small sample project and Submit an incident to Infragistics Developer Support so they can take a look.