Microsoft KB Archive/265845

= BUG: eVB: Label with AutoSize = True Returns Incorrect Height at Run Time =

Article ID: 265845

Article Last Modified on 8/19/2005

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0
 * Microsoft Windows CE Toolkit for Visual Basic 6.0

-



This article was previously published under Q265845



SYMPTOMS
If you have a Label control that has its AutoSize property set to True, then the Height property returns the value set at design time or when it was last set.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Open Microsoft eMbedded Visual Basic 3.0. Create a new Windows CE for the Pocket PC project. Form1 is created by default. Add a Label control and two Command Button controls to Form1.  Paste the following code into Form1: Option Explicit

Private Sub Command1_Click Label1.AutoSize = True End Sub

Private Sub Command2_Click MsgBox &quot;Height = &quot; & Label1.Height & &quot; Width = &quot; & Label1.Width End Sub

Private Sub Form_Load Label1.Caption = &quot;This is a two line &quot; & vbLf & &quot;caption for Label1.&quot; Label1.Font.Size = 14 Label1.Height = 200 Label1.Width = 200 End Sub

Private Sub Form_OKClick App.End End Sub  Run the project in emulation or on the device. Click on Command2 to check the height and width dimensions for Label1. Both of them should be 200.</li> Click on Command1 to set the AutoSize property to True. Note that both the height and width dimensions of the label have changed.</li> When you click Command2, note that the height is still 200, although the width returns the new value.</li></ol>

Additional query words: wce vbce evb

Keywords: kbbug kbtoolkit kbpending KB265845

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.