SAMPLE: Windows 3.1 Window Styles

Last reviewed: April 7, 1997
Article ID: Q83556
3.10 WINDOWS kbprg kbfile

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SUMMARY

Microsoft Windows version 3.1 introduces five new window styles and two new extended window styles. An application can specify any of the five new window styles as the dwStyle parameter for the CreateWindow function. Likewise, an application can specify either of the two new extended window styles as the dwExStyle parameter for the CreateWindowEx function.

STYLES is a file in the Microsoft Software Library that demonstrates using all the styles listed below except for MDIS_ALLCHILDSTYLES.

Download STYLES.EXE from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download STYLES.EXE (size: 48835 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get STYLES.EXE (size: 48835 bytes) 
    

MORE INFORMATION

The text below explains the behavior of windows created with the window styles added to Windows 3.1.

Combo Box Style

CBS_DISABLENOSCROLL -- The list box portion of a combo box shows a disabled vertical scroll bar when the list box can display all items it contains without scrolling the contents. Without this style, the scroll bar is hidden when the list box can display all items.

Edit Control Styles

ES_READONLY -- The user cannot enter or edit text in the edit control.

ES_WANTRETURN -- This style can be used for a multiline edit control in a dialog box. Each time the user presses the ENTER key while the multiline edit control has the focus, Windows adds a carriage return to the edit control's contents. Without this style, pressing the ENTER key triggers the dialog box's default push button. This style does not affect a single-line edit control.

List Box Style

LBS_DISABLENOSCROLL -- A list box shows a disabled vertical scroll bar when the list box can display all items it contains. Without this style, the scroll bar is hidden when the list box can display all items.

MDI Client Style

MDIS_ALLCHILDSTYLES -- This style can be specified when an application creates multiple document interface (MDI) client windows. When an application creates MDI children of an MDI client window that has the MDIS_ALLCHILDSTYLES style, Windows will create the children with exactly the styles specified in the style field of the MDICREATESTRUCT structure; the default MDI child window styles are not enforced.

The text below explains the behavior of windows created with the extended window styles added to Windows 3.1.

WS_EX_ACCEPTFILES -- The window will accept files using the drag-drop interface.

WS_EX_TOPMOST -- Windows places the window above all non-topmost windows. The window will stay above all non-topmost windows even when the window is deactivated. After a window is created, an application can use the SetWindowPos function to add or remove this attribute.


Additional reference words: 3.10 softlib STYLE.EXE
KBCategory: kbprg kbfile
KBSubcategory: UsrWndw
Keywords : UsrWndw kbfile kbprg
Version : 3.10
Platform : 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: April 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.