HOWTO: How to Create a Recessed Status Bar Area (132110)



The information in this article applies to:

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

This article was previously published under Q132110

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.

Modification Type:MajorLast Reviewed:12/9/2003
Keywords:kbhowto kbToolbar KbUIDesign KB132110