PRB: Stacked Tabs Aren't Displayed Correctly After AddPage()

Last reviewed: July 10, 1997
Article ID: Q142446
4.00 WINDOWS NT kbprg kbprb

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++, 32-bit Edition, version 4.0

SYMPTOMS

When CPropertySheet::AddPage() is called and a tab is too wide to fit in the existing row of tabs, the CPropertySheet will create a new row with the new tab. This can cause the bottom row of tabs to disappear.

NOTE: This will only occur when calling CPropertySheet::AddPage() after calling CPropertySheet::Create or CPropertySheet::DoModal().

CAUSE

The CPropertyPage and CPropertySheet are not resized when AddPage() is called. As a result, the active CPropertyPage could cover a row of tabs and obscure it from view.

RESOLUTION

You can do either of the following:

  • Call CPropertySheet::EnableStackedTabs(FALSE) before the call to DoModal() or Create(). This will disable stacked tabs. When there isn't enough space to add a tab and AddPage() is called, a scrollbar will appear which allows you to scroll to the desired tab.

    -or-

  • Call AddPage() for all possible pages. This will create a CPropertySheet with CProppertyPage items whose size will allow for the additional rows of tabs. If you don't want to display all of the pages initially, derive a class from CPropertySheet, override CPropertySheet::OnInitDialog(), and remove unwanted tabs by calling RemovePage().


Additional reference words: 4.00
KBCategory: kbprg kbprb
KBSubcategory: MfcUI
Keywords : MfcUI kbprb kbprg
Technology : kbMfc
Version : 4.00
Platform : NT WINDOWS


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: July 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.