BUG: TabStrip Control Incorrectly Displays TABs on Form_Load

ID: Q145567


The information in this article applies to:
  • Microsoft Visual Basic Standard, Professional, and Enterprise Editions, 32-bit only, for Windows, 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.


Additional query words: 4.00 4.00a vb4win vb432 buglist4.00

Keywords : PrgCtrlsCus
Version : 4.00 | 4.00
Platform : NT WINDOWS
Issue type :


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