BUG: TabStrip Control Incorrectly Displays TABs on Form_Load

Last reviewed: May 20, 1996
Article ID: Q145567
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic for Windows, 32-bit only, version 4.0

SUMMARY

A Visual Basic program with a TabStrip control does not correctly display the TAB during run-time if the TAB height is set in the Form_Load procedure of the form. The TAB is correctly displayed if the TAB height is set in any other procedure except Form_Load.

STATUS

Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. This problem has been corrected in the Microsoft Visual Basic version 4.0a for Windows synchronization release.

WORKAROUND

To work around this issue, show and refresh the TabStrip control in the Form_Load event before setting the TAB height.

MORE INFORMATION

The following creates an example to reproduce this behavior. A Picture control is moved to the TAB area of the TabStrip control during the Form_Load procedure. The same code in the Form_Load procedure is also in the Form_Click procedure.

When you run this example, the TAB does not appear. Click the Form and the TAB appears.

Steps to Reproduce Behavior

  1. Start the 32-bit version of Visual Basic 4.0 or if it is already running, click New Project on the File menu.

  2. Add a TabStrip and a Picture control to the Form1 form.

  3. Copy the following code sample to the Form1 code window:

          Option Explicit
    

          Private Sub Form_Click()
    

          'Uncomment the next two lines to work around this issue.
          'Me.Show
          'TabStrip1.Refresh
    

          'Move the Picture1 control to the display area.
          'of the TabStrip control
    
             With TabStrip1
                Picture1.Move .ClientLeft, .ClientTop, _
                              .ClientWidth, .ClientHeight
             End With
          End Sub
    
          Private Sub Form_Load()
    
          'Move the Picture1 control to the display area.
          'of the TabStrip control
             With TabStrip1
                Picture1.Move .ClientLeft, .ClientTop, _
                              .ClientWidth, .ClientHeight
             End With
          End Sub
    
    

  4. On the Run menu, click Start or press the F5 key to start the program. Click on the form and note that the TAB appears.


KBCategory: kbprg kbbuglist kbfixlist
KBSubcategory: PrgCtrlsCus
Additional reference words: 4.00 4.00a vb4win vb432 buglist4.00


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