The SBS_SIZEBOX Style

Last reviewed: November 2, 1995
Article ID: Q102485
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.5 and 3.51
        - Microsoft Windows 95 version 4.0
    

SUMMARY

A size box is a small rectangle the user can expand to change the size of the window. When you want a size box, you create a SCROLLBAR window with the SBS_SIZEBOX flag. This action creates a size box with the height, width, and position that you specified in the call to CreateWindow. If you specify SBS_SIZEBOXBOTTOMRIGHTALIGN, the box will be aligned in the lower right of the rectangle you specified when creating the window. If you specify SBS_SIZEBOXTOPLEFTALIGN, the box will be aligned in the upper left of the rectangle you specified in your call to CreateWindow().

MORE INFORMATION

The user moves the mouse pointer over to the box, presses and holds the left mouse button, and drags the mouse pointer to resize the window. When the user does this, the borders on the window (the frame) move. When the user releases the mouse button, the window is resized.

You create a size box by creating a child window of type WS_CHILD | WS_VISIBLE | SBS_SIZEBOX | SBS_SIZEBOXTOPLEFTALIGN. You don't have to do any of the processing for this; the system will take care of it. You will notice in your window procedure that you will get the scroll bar messages plus the WM_MINMAXINFO message. Size boxes work similar to the way the WS_THICKFRAME/WS_SIZEBOX style does on a window.

Under Windows NT, applications that create a size box either using WS_SIZEBOX or WS_THICKFRAME or by created the SBS_SIZEBOX control have no way of showing the user that such a feature exists. Under Windows 95, the size box appears as a jagged edge, usually at the bottom right corner.

NOTE: Make sure that the main window is created with the WS_VSCROLL and WS_HSCROLL styles.


Additional reference words: 3.10 3.50 4.00 sizebox
KBCategory: kbui
KBSubcategory: UsrCtl


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: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.