Microsoft KB Archive/94789

= Height/Width Properties of Attached Scroll Bars May Be Wrong =

PSS ID Number: 94789

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q94789



SYMPTOMS
The Height property of a vertical scroll bar and the Width property of a horizontal scroll bar that are attached to a form (Attached property is True), are reported incorrectly until after the first Resize event returns.



WORKAROUND
To work around the problem, do not use the scroll bar Width or Height property values until after the form has been resized.



STATUS
Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The first time that the Resize event is called, Microsoft Visual Basic for MS-DOS reports the Height of a vertical scroll bar and the Width of a horizontal scroll bar incorrectly when they are attached to the form. The reported value is one greater than the correct value. This also occurs if these values are reported from another form or in the form's Load event before the form is shown.

Steps to Reproduce Problem
 Start VBDOS.EXE. From the File menu, choose New Form. Place a Horizontal Scroll Bar control on the new form. Set the AutoRedraw property of the form to True. Set the Attached property of the Scroll Bar to True. From the File menu, choose Exit, and save all changes.</li>  Add the following code to the Form_Resize event procedure: Sub Form_Resize Print Hscroll1.Width End Sub </li>  Add the following code to the Form_Click event procedure: Sub Form_Click Print Hscroll1.Width End Sub </li> Run the program.</li> Click anywhere on the form. Notice that the Width printed from the Resize event is one more than the second Width value printed.</li></ol>

Additional query words: VBmsdos Buglist1.00 1.00

Keywords: KB94789

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.