Height/Width Properties of Attached Scroll Bars May Be Wrong

ID: Q94789


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


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

  1. Start VBDOS.EXE.


  2. From the File menu, choose New Form.


  3. Place a Horizontal Scroll Bar control on the new form.


  4. Set the AutoRedraw property of the form to True.


  5. Set the Attached property of the Scroll Bar to True.


  6. From the File menu, choose Exit, and save all changes.


  7. Add the following code to the Form_Resize event procedure:
    
          Sub Form_Resize ()
              Print Hscroll1.Width
          End Sub 


  8. Add the following code to the Form_Click event procedure:
    
          Sub Form_Click ()
              Print Hscroll1.Width
          End Sub 


  9. Run the program.


  10. Click anywhere on the form. Notice that the Width printed from the Resize event is one more than the second Width value printed.


Additional query words: VBmsdos Buglist1.00 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.