BUG: Grid Custom Control: Scroll Bars Displayed Unnecessarily

Last reviewed: June 21, 1995
Article ID: Q80967
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  versions 2.0 and 3.0
- Microsoft Professional Toolkit for Microsoft Visual Basic programming
  system for Windows, version 1.0

SYMPTOMS

Under the following conditions, the Grid custom control incorrectly displays horizontal and vertical scroll bars when all the columns and rows fit in the control (which eliminates the need for scroll bars):

  • The ScrollBars property is set to 3 (Both).
  • The distance between the right column and the right edge of the control is less than the default width of a column.
  • The distance between the bottom row and the bottom edge of the control is less than the default width a row.

WORKAROUND

To work around this problem, add the following statements to the Form_Load procedure to set the ScrollBars property to 0 (none), then back to the original setting.

   Sub Form_Load ()
      save% = Grid1.ScrollBars   ' save setting
      Grid1.ScrollBars = 0       ' turn off scroll bars
      Grid1.ScrollBars = save%   ' restore setting
   End Sub

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. From the File menu, choose Add File. In the Files box, select the GRID.VBX custom control file. The Grid tool appears in the Toolbox.

  3. Place a grid named Grid1 on Form1.

  4. Set the grid properties Cols and Rows each to 3.

  5. Size the grid so that all columns and rows are visible. Leave a small space between the grid area and the edge of the control.

  6. From the Run menu, choose Start, or press F5 to run the program. Both horizontal and vertical scroll bars incorrectly appear.


Additional reference words: buglist1.00 buglist2.00 buglist3.00 1.00 2.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsCus


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.