Article ID: 135651
Article Last Modified on 1/8/2003
MsgBox "Start Width=" & Label1.Width
For i = 1 To 50
Label1.Caption = Label1.Caption & "This is my Text "
Next
MsgBox "Final Width=" & Label1.Width
MsgBox "Start Width=" & Label1.Width
OriginalWidth = Label1.Width
Label1.Visible = False
For i = 1 To 50
Label1.Caption = Label1.Caption & "This is my Text "
Next
Label1.Width = OriginalWidth
Label1.Visible = True
MsgBox "Final Width=" & Label1.Width
This workaround suitable only for solving the large increases in label
width that are seen in version 3.0. The AutoSize feature will probably
cause the final width of the control to be slightly larger than the
original width of the label as more text is added, even when the width is
explicitly set. The differences between the initial and final widths of the
control after text is added to the caption will depend on the content of
the new caption and the font characteristics.
Additional query words: kbVBp400 kbVBp300 kbCtrl kbDSupport kbdsd
Keywords: kbprb KB135651