Quote Originally Posted by Eduardo- View Post
There is a bug in the LabelW control in the DoAutoSize procedure.

The line:
Code:
.Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
Should be changed to:
Code:
If PropWordWrap = True Then
    .Extender.Move .Extender.Left, .Extender.Top, .Extender.Width, .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
Else
    .Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
End If
Hi Eduardo,

I updated yesterday your suggested bugfix. However, I think the behavior is now not really correct.

E.g. make a LabelW1.Caption = "test" with a Width of 255 and WordWrap = True and AutoSize = True.
Now change the Caption to "test_added". The VB.Label autosize the width while now the LabelW doesn't.

My proposed solution would be:
Code:
If PropWordWrap = True Then
    .Extender.Height = .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
    If .ScaleWidth < ((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2)) Then .Extender.Width = .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize)
Else
    .Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
End If
Can you confirm before I update another bugfix?