BUG: A Picture Box Containing Labels May Not Repaint Correctly

Last reviewed: October 8, 1996
Article ID: Q150182
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0

SYMPTOMS

A picture box that contains labels and is larger than the screen size does not repaint correctly.

STATUS

Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.

WORKAROUND

Use text boxes without borders - BorderStyle set to None - and a BackColor set to the same color as the label to substitute for the labels. The text boxes should be made read-only.

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q110403
   TITLE     : How to Create a Read-Only Text Box Using SendMessage API

MORE INFORMATION

Steps To Reproduce Problem

  1. Start a new project. Form1 is created by default. Place a picture box on the form, and then place a label control inside the picture box.

  2. In the Properties window for the picture box, change the Height property to a large value, such as 20000.

  3. Drag the picture box up until you can view the lower border. Notice that the section of the picture box that was below the screen does not correctly repaint. When the label is removed, the problem goes away.

NOTE: This problem can also occur at run-time.


Additional reference words: 4.00 vb4win vb4all
KBCategory: kbprg kbbuglist
KBSubcategory: PrgOther


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: October 8, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.