KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q132110: HOWTO: How to Create a Recessed Status Bar Area

Article: Q132110
Product(s): Microsoft C Compiler
Version(s): winnt:2.0,2.1,4.0
Operating System(s): 
Keyword(s): kbMFC kbToolbar KbUIDesign kbVC100 kbVC150 kbVC200 kbVC400 kbGrpDSMFCATL
Last Modified: 29-JUL-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- The Microsoft Foundation Classes (MFC), used with:
   - Microsoft Visual C++ for Windows, 16-bit edition, versions 1.0, 1.5, 1.51, 1.52 
   - Microsoft Visual C++, 32-bit Editions, versions 2.0, 2.1, 4.0 
-------------------------------------------------------------------------------

SUMMARY
=======

To implement a sunken or recessed border around the first pane of the status
bar, you need to have SBPS_STRETCH style set for this pane.

MORE INFORMATION
================

This style can be set immediately after you create the status bar in the
CMainFrame::OnCreate handler of your Appwizard-generated application. Add the
following call to SetPaneInfo in the CMainFrame::OnCreate handler:

     int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
     {
     // Code generated by the framework

      m_wndStatusBar.SetPaneInfo( 0, m_wndStatusBar.GetItemID( 0 ),
             SBPS_STRETCH, NULL );
     }

Here m_wndStatusBar is the CStatusBar member variable of the CMainFrame class,
and CStatusBar::GetItemID() returns the ID of the first pane.

NOTE: Only one pane of the status bar can have this style set.

REFERENCES
==========

For additional information on this style, please see CStatusBar::SetPaneInfo()
in the Foundation Classes Help file.

Additional query words: kbinf 1.00 1.50 2.50 2.51 2.52 2.00 2.10 3.00 3.10 4.00

======================================================================
Keywords          : kbMFC kbToolbar KbUIDesign kbVC100 kbVC150 kbVC200 kbVC400 kbGrpDSMFCATL 
Technology        : kbAudDeveloper kbMFC
Version           : winnt:2.0,2.1,4.0
Issue type        : kbhowto

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.