|
-
Feb 20th, 2020, 03:53 AM
#10
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Eduardo-
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|