Hello, I'm using UniLabelWL e UniLabelXP controls in a VB6 application.
If I set "WordWrap" and "Autosize" properties to TRUE I get two different results for UniLabelWL e UniLabelXP controls assigning a text to the label. The first one resizes itself in the same way that Label Microsoft. Instead for UniLabelXP control resize itself with a different height and display a truncated text. Is there a way to get the same result from UniLabelXP control?
In addition for UniLabelWL control I get the correct resize (the same that happens with label Microsoft) but if I try to read "Height" and "Width" property after resize I get a wrong value (I suppose the old one). What am I doing wrong? You can see the issue in the test code linked above.
There was a problem in the ctlUniLabelXP widget, now it has been fixed (I've just released revision 54)
I noticed the issue in ctlUniLabelWL when assigning a caption and read the size just after this operation.
I think the behavior is related to the fact that the widget is WindowLess so it doesn't have a so called Device Context (a graphical object that permits Windows API to draw inside) so I can paint the component only in a specific event.
Unfortunately this event doesn't support the resize at the same time and I think this could cause the issue.
Infact if you press your button twice you'll notice that the second time values are correct. You can fix the second problem in 2 ways: 1- Use a ctlUniLabelXP (now it works as expected) 2- add a "DoEvents" call before reading the size