HOWTO: Remove the Sizing Grip From a Status BarLast reviewed: November 26, 1997Article ID: Q177341 |
The information in this article applies to:
SUMMARYA statusbar control has some diagonal lines in the right lower corner called the sizing grip, that can be used to resize the window. Occasionally, a programmer may want to remove this grip to prevent the user from resizing the window. For instance, a programmer may want to do this if they prevented the mainframe window from resizing by removing the WS_THICKFRAME style. In this situation, if the user grabs the status bar sizing grip and resizes the statusbar, painting problems can occur.
MORE INFORMATIONYou can remove the sizing grip by deriving a class from CStatusBar and overriding PreCreateWindow() to change the styles that are used. Inside of PreCreateWindow(), you must also remove the SBARS_SIZEGRIP style. For example:
BOOL CMyStatusbar::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs. cs.style &= ~SBARS_SIZEGRIP; return CStatusBar::PreCreateWindow(cs); }You can then replace your custom CStatusBar derived class with the default one. For example, if this is the statusbar in the main frame window, you would then include the header file for your CStatusBar derived class in your Mainfrm.h file. Also in your Mainfrm.h file, you would change the declaration of the statusbar created in your Mainfrm.cpp file to use that class.
REFERENCESFor additional information, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q99161 TITLE : HOWTO: Derive From Classes not Listed in ClassWizard(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Philip Spory, Microsoft Corporation Keywords : MfcUI Version : WINNT:5.0 Platform : winnt Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |