Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use the following style flags to specify window or control appearance and behavior when you create the corresponding MFC object. In most cases, these styles are set in the dwStyle parameter of the class Create function.
Button styles
Button styles apply to CButton Class objects, such as radio buttons, check boxes and pushbuttons. Specify a combination of styles in the dwStyle parameter of CButton::Create. For more information on button styles in Windows, see Button Styles (Windows).
Button types
The following table lists button types. You can optionally choose one of the following. If you do not specify a button type, the default is BS_PUSHBUTTON.
| Type | Description | 
|---|---|
| BS_3STATE | Creates a check box button with three states: BST_CHECKED,BST_INDETERMINATE, andBST_UNCHECKED. Clicking on the button sends aBN_CLICKEDnotification to the owner window but does not change the state of the button. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_AUTO3STATE | Creates a check box button with three states: BST_CHECKED,BST_INDETERMINATE, andBST_UNCHECKED. Clicking on the button sends aBN_CLICKEDnotification to the owner window and changes the state of the button. The button states cycle in the order ofBST_CHECKED,BST_INDETERMINATE, andBST_UNCHECKED. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_AUTOCHECKBOX | Creates a check box button with two states: BST_CHECKEDandBST_UNCHECKED. Clicking on the button sends aBN_CLICKEDnotification to the owner window and changes the state of the button. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_AUTORADIOBUTTON | Creates a radio button with two states: BST_CHECKEDandBST_UNCHECKED. Radio buttons are usually used in groups, with each group having a maximum of one checked option at a time. Clicking on the button sends aBN_CLICKEDnotification to the owner window, sets the state of the clicked radio button toBST_CHECKED, and sets the states of all other radio buttons in the button group toBST_UNCHECKED. By default, associated text is displayed to the right of the radio button. To display text to the left of the radio button, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_CHECKBOX | Creates a check box button with two states: BST_CHECKEDandBST_UNCHECKED. Clicking on the button sends aBN_CLICKEDnotification to the owner window but does not change the state of the button. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_COMMANDLINK | Creates a command link button. A command link button is a command button specific to Windows Vista that displays a green arrow to the left of the main text and a note below the main text. You can set the note text using CButton::SetNote. | 
| BS_DEFCOMMANDLINK | Creates a command link button. A command link button is a command button specific to Windows Vista that displays a green arrow to the left of the main text and a note below the main text. You can set the note text using CButton::SetNote. If the button is in a dialog box, pressing the ENTER key sends aBN_CLICKEDnotification to the dialog box even when the button does not have the input focus. | 
| BS_DEFPUSHBUTTON | Creates a command button that has a heavy black border. If the button is in a dialog box, pressing the ENTER key sends a BN_CLICKEDnotification to the dialog box even when the button does not have the input focus. | 
| BS_DEFSPLITBUTTON | Creates a split button. A split button is a command button specific to Windows Vista that contains a button adjacent to a drop-down arrow. When you click the button, the default command is executed. When you click the drop-down arrow, a menu of additional commands appears. If the split button is in a dialog box, pressing the ENTER key sends a BN_CLICKEDnotification to the dialog box even when the button does not have the input focus | 
| BS_GROUPBOX | Creates a rectangle in which other buttons can be grouped. Text associated with this style is displayed in the rectangle's upper-left corner. | 
| BS_OWNERDRAW | Creates an owner-drawn button. The framework calls the DrawItemmethod when a visual aspect of the button has changed. This style must be set when you use theCBitmapButtonclass. | 
| BS_PUSHBUTTON | Creates a command button that sends a BN_CLICKEDnotification to the owner window when the user clicks the button. | 
| BS_RADIOBUTTON | Creates a radio button with two states: BST_CHECKEDandBST_UNCHECKED. Radio buttons are usually used in groups, with each group having a maximum of one checked option at a time. Clicking on the button sends aBN_CLICKEDnotification to the owner window but does not automatically change the state of any button in the group. By default, associated text is displayed to the right of the radio button. To display text to the left of the radio button, use theBS_LEFTTEXTorBS_RIGHTBUTTONstyle. | 
| BS_SPLITBUTTON | Creates a split button. A split button is a command button specific to Windows Vista that contains a button adjacent to a drop-down arrow. When you click the button, the default command is executed. When you click the drop-down arrow, a menu of additional commands appears. | 
| BS_USERBUTTON | Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAWinstead. | 
Radio button and check box styles
The following table lists styles that are specific to radio buttons and check boxes. These styles are ignored in all other button types. You can optionally choose one or more of the following.
| Style | Description | 
|---|---|
| BS_LEFTTEXT | When combined with a radio button or check-box style, the text appears on the left side of the radio button or check box. | 
| BS_RIGHTBUTTON | When combined with a radio button or check-box style, the text appears on the left side of the radio button or check box. This style is identical to the BS_LEFTTEXTstyle. | 
| BS_PUSHLIKE | Makes a check box or radio button look and behave like a command button. The button appears pressed when its state is BST_CHECKED, pressed and dimmed when its state isBST_INDETERMINATE, and released when its state isBST_UNCHECKED. | 
Button text alignment styles
The following table lists horizontal and vertical text alignment options. You can optionally choose one of the following.
| Style | Description | 
|---|---|
| BS_LEFT | Left aligns the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTONstyle, the text is left aligned on the right side of the check box or radio button. | 
| BS_RIGHT | Right aligns the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTONstyle, the text is right aligned on the right side of the check box or radio button. | 
| BS_CENTER | Centers text horizontally in the button rectangle. | 
| BS_TOP | Places text at the top of the button rectangle. | 
| BS_BOTTOM | Places text at the bottom of the button rectangle. | 
| BS_VCENTER | Centers text vertically in the button rectangle. | 
Button content options
The following table lists options that indicate what is displayed in the button. Button types that only display text ignore these styles. You can optionally choose one of the following.
| Style | Description | 
|---|---|
| BS_BITMAP | Specifies that the button displays a bitmap. | 
| BS_ICON | Specifies that the button displays an icon. | 
| BS_TEXT | Specifies that the button displays text. | 
Other button options
The following table lists additional options that you can use with any button type. You can optionally choose one or more of the following.
| Style | Description | 
|---|---|
| BS_FLAT | Specifies that the button is two-dimensional and is not drawn with default shading to create a three-dimensional image. | 
| BS_MULTILINE | Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle. | 
| BS_NOTIFY | Enables a button to send BN_DBLCLK,BN_KILLFOCUS, andBN_SETFOCUSnotification messages to its parent window. Note that buttons send theBN_CLICKEDnotification regardless of whether this style is specified. | 
Combo-box styles
The following combo-box styles are available in MFC. For more information about combo-box styles in Windows, see Combo Box Styles (Windows).
| Style | Description | 
|---|---|
| CBS_AUTOHSCROLL | Automatically scrolls the text in the edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed. | 
| CBS_DISABLENOSCROLL | The list box shows a disabled vertical scroll bar when the list box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items. | 
| CBS_DROPDOWN | Similar to CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control. | 
| CBS_DROPDOWNLIST | Similar to CBS_DROPDOWN, except that the edit control is replaced by a static-text item that displays the current selection in the list box. | 
| CBS_HASSTRINGS | An owner-draw combo box contains items consisting of strings. The combo box maintains the memory and pointers for the strings so the application can use the GetTextmember function to retrieve the text for a particular item. | 
| CBS_LOWERCASE | Converts to lowercase all text in both the selection field and the list. | 
| CBS_NOINTEGRALHEIGHT | Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, Windows sizes a combo box so that the combo box does not display partial items. | 
| CBS_OEMCONVERT | Text entered in the combo-box edit control is converted from the ANSI character set to the OEM character set and then back to ANSI. This ensures proper character conversion when the application calls the AnsiToOemWindows function to convert an ANSI string in the combo box to OEM characters. This style is most useful for combo boxes that contain filenames and applies only to combo boxes created with theCBS_SIMPLEorCBS_DROPDOWNstyles. | 
| CBS_OWNERDRAWFIXED | The owner of the list box is responsible for drawing its contents; the items in the list box are all the same height. | 
| CBS_OWNERDRAWVARIABLE | The owner of the list box is responsible for drawing its contents; the items in the list box are variable in height. | 
| CBS_SIMPLE | The list box is displayed at all times. The current selection in the list box is displayed in the edit control. | 
| CBS_SORT | Automatically sorts strings entered into the list box. | 
| CBS_UPPERCASE | Converts to uppercase all text in both the selection field and the list. | 
Edit styles
Edit styles apply to CEdit Class objects. Specify a combination of styles in the dwStyle parameter of CEdit::Create. For more information about edit control styles in Windows, see Edit Control Styles (Windows).
| Style | Description | 
|---|---|
| ES_AUTOHSCROLL | Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position 0. | 
| ES_AUTOVSCROLL | Automatically scrolls text up one page when the user presses ENTER on the last line. | 
| ES_CENTER | Centers text in a single-line or multiline edit control. | 
| ES_LEFT | Left-aligns text in a single-line or multiline edit control. | 
| ES_LOWERCASE | Converts all characters to lowercase as they are typed into the edit control. | 
| ES_MULTILINE | Designates a multiple-line edit control. (The default is single line.) If the ES_AUTOVSCROLLstyle is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. IfES_AUTOVSCROLLis not given, the edit control shows as many lines as possible and beeps if ENTER is pressed when no more lines can be displayed. If theES_AUTOHSCROLLstyle is specified, the multiple-line edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press ENTER. IfES_AUTOHSCROLLis not given, the control automatically wraps words to the beginning of the next line when necessary; a new line is also started if ENTER is pressed. The position of the wordwrap is determined by the window size. If the window size changes, the wordwrap position changes and the text is redisplayed. Multiple-line edit controls can have scroll bars. An edit control with scroll bars processes its own scroll-bar messages. Edit controls without scroll bars scroll as described above and process any scroll messages sent by the parent window. | 
| ES_NOHIDESEL | Normally, an edit control hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. Specifying ES_NOHIDESELdeletes this default action. | 
| ES_NUMBER | Allows only digits to be entered into the edit control. | 
| ES_OEMCONVERT | Text entered in the edit control is converted from the ANSI character set to the OEM character set and then back to ANSI. This ensures proper character conversion when the application calls the AnsiToOemWindows function to convert an ANSI string in the edit control to OEM characters. This style is most useful for edit controls that contain filenames. | 
| ES_PASSWORD | Displays all characters as an asterisk (*) as they are typed into the edit control. An application can use the SetPasswordCharmember function to change the character that is displayed. | 
| ES_READONLY | Prevents the user from entering or editing text in the edit control. | 
| ES_RIGHT | Right-aligns text in a single-line or multiline edit control. | 
| ES_UPPERCASE | Converts all characters to uppercase as they are typed into the edit control. | 
| ES_WANTRETURN | Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiple-line edit control in a dialog box. Without this style, pressing the ENTER key has the same effect as pressing the dialog box's default pushbutton. This style has no effect on a single-line edit control. | 
Frame-window styles
Frame-window styles apply to CFrameWnd Class objects. Specify a combination of styles in the dwStyle parameter of CFrameWnd::Create.
| Style | Description | 
|---|---|
| FWS_ADDTOTITLE | Specifies information to append to the end of a frame window title. For example, "Microsoft Draw - Drawing in Document1". You can specify the strings displayed in the Document Template Strings tab in the Application Wizard. If you need to turn this option off, override the CWnd::PreCreateWindowmember function. | 
| FWS_PREFIXTITLE | Shows the document name before the application name in a frame window title. For example, "Document - WordPad". You can specify the strings displayed in the Document Template Strings tab in the Application Wizard. If you need to turn this option off, override the CWnd::PreCreateWindowmember function. | 
| FWS_SNAPTOBARS | Controls sizing of the frame window that encloses a control bar when it is in a floating window rather than docked to a frame window. This style sizes the window to fit the control bar. | 
List-box styles
List-box styles apply to CListBox Class objects. Specify a combination of styles in the dwStyle parameter of CListBox::Create. For more information about list box styles in Windows, see List Box Styles (Windows).
| Style | Description | 
|---|---|
| LBS_DISABLENOSCROLL | The list box shows a disabled vertical scroll bar when the list box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items. | 
| LBS_EXTENDEDSEL | The user can select multiple items using the SHIFT key and the mouse or special key combinations. | 
| LBS_HASSTRINGS | Specifies an owner-draw list box that contains items consisting of strings. The list box maintains the memory and pointers for the strings so the application can use the GetTextmember function to retrieve the text for a particular item. | 
| LBS_MULTICOLUMN | Specifies a multicolumn list box that is scrolled horizontally. The SetColumnWidthmember function sets the width of the columns. | 
| LBS_MULTIPLESEL | String selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected. | 
| LBS_NODATA | Specifies a no-data list box. Specify this style when the count of items in the list box will exceed one thousand. A no-data list box must also have the LBS_OWNERDRAWFIXEDstyle, but must not have theLBS_SORTorLBS_HASSTRINGSstyle.A no-data list box resembles an owner-drawn list box except that it contains no string or bitmap data for an item. Commands to add, insert, or delete an item always ignore any given item data; requests to find a string within the list box always fail. The system sends the WM_DRAWITEMmessage to the owner window when an item must be drawn. The itemID member of theDRAWITEMSTRUCTstructure passed with theWM_DRAWITEMmessage specifies the line number of the item to be drawn. A no-data list box does not send aWM_DELETEITEMmessage. | 
| LBS_NOINTEGRALHEIGHT | The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items. | 
| LBS_NOREDRAW | List-box display is not updated when changes are made. This style can be changed at any time by sending a WM_SETREDRAWmessage. | 
| LBS_NOSEL | Specifies that the list box contains items that can be viewed but not selected. | 
| LBS_NOTIFY | Parent window receives an input message whenever the user clicks or double-clicks a string. | 
| LBS_OWNERDRAWFIXED | The owner of the list box is responsible for drawing its contents; the items in the list box are the same height. | 
| LBS_OWNERDRAWVARIABLE | The owner of the list box is responsible for drawing its contents; the items in the list box are variable in height. | 
| LBS_SORT | Strings in the list box are sorted alphabetically. | 
| LBS_STANDARD | Strings in the list box are sorted alphabetically, and the parent window receives an input message whenever the user clicks or double-clicks a string. The list box contains borders on all sides. | 
| LBS_USETABSTOPS | Allows a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog units. (A dialog unit is a horizontal or vertical distance. One horizontal dialog unit is equal to one-fourth of the current dialog base width unit. The dialog base units are computed based on the height and width of the current system font. The GetDialogBaseUnitsWindows function returns the current dialog base units in pixels.) This style should not be used withLBS_OWNERDRAWFIXED. | 
| LBS_WANTKEYBOARDINPUT | The owner of the list box receives WM_VKEYTOITEMorWM_CHARTOITEMmessages whenever the user presses a key while the list box has input focus. This allows an application to perform special processing on the keyboard input. | 
Message-box styles
Message-box styles apply to AfxMessageBox items. Specify a combination of styles in the nType parameter of AfxMessageBox. For more information about message box styles in Windows, see MessageBox Function (Windows).
The following message-box styles are available.
Message-box types
| Style | Description | 
|---|---|
| MB_ABORTRETRYIGNORE | The message box contains three pushbuttons: Abort, Retry, and Ignore. | 
| MB_OK | The message box contains one pushbutton: OK. | 
| MB_OKCANCEL | The message box contains two pushbuttons: OK and Cancel. | 
| MB_RETRYCANCEL | The message box contains two pushbuttons: Retry and Cancel. | 
| MB_YESNO | The message box contains two pushbuttons: Yes and No. | 
| MB_YESNOCANCEL | The message box contains three pushbuttons: Yes, No, and Cancel. | 
Message-box modality
| Style | Description | 
|---|---|
| MB_APPLMODAL | The user must respond to the message box before continuing work in the current window. However, the user can move to the windows of other applications and work in those windows. The default is MB_APPLMODALif neitherMB_SYSTEMMODALnorMB_TASKMODALis specified. | 
| MB_SYSTEMMODAL | All applications are suspended until the user responds to the message box. System-modal message boxes are used to notify the user of serious, potentially damaging errors that require immediate attention and should be used sparingly. | 
| MB_TASKMODAL | Similar to MB_APPLMODAL, but not useful within a Microsoft Foundation class application. This flag is reserved for a calling application or library that does not have a window handle available. | 
Message-box icons
| Style | Description | 
|---|---|
| MB_ICONEXCLAMATION | An exclamation-point icon appears in the message box. | 
| MB_ICONINFORMATION | An icon consisting of an "I" in a circle appears in the message box. | 
| MB_ICONQUESTION | A question-mark icon appears in the message box. | 
| MB_ICONSTOP | A stop-sign icon appears in the message box. | 
Message-box default buttons
| Style | Description | 
|---|---|
| MB_DEFBUTTON1 | The first button is the default. Note that the first button is always the default unless MB_DEFBUTTON2orMB_DEFBUTTON3is specified. | 
| MB_DEFBUTTON2 | The second button is the default. | 
| MB_DEFBUTTON3 | The third button is the default. | 
Scroll-bar styles
Scroll-bar styles apply to CScrollBar Class objects. Specify a combination of styles in the dwStyle parameter of CScrollBar::Create. For more information about scroll bar control styles in Windows, see Scroll Bar Control Styles (Windows).
| Style | Description | 
|---|---|
| SBS_BOTTOMALIGN | Used with the SBS_HORZstyle. The bottom edge of the scroll bar is aligned with the bottom edge of the rectangle specified in theCreatemember function. The scroll bar has the default height for system scroll bars. | 
| SBS_HORZ | Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGNnorSBS_TOPALIGNstyle is specified, the scroll bar has the height, width, and position given in theCreatemember function. | 
| SBS_LEFTALIGN | Used with the SBS_VERTstyle. The left edge of the scroll bar is aligned with the left edge of the rectangle specified in theCreatemember function. The scroll bar has the default width for system scroll bars. | 
| SBS_RIGHTALIGN | Used with the SBS_VERTstyle. The right edge of the scroll bar is aligned with the right edge of the rectangle specified in theCreatemember function. The scroll bar has the default width for system scroll bars. | 
| SBS_SIZEBOX | Designates a size box. If neither the SBS_SIZEBOXBOTTOMRIGHTALIGNnorSBS_SIZEBOXTOPLEFTALIGNstyle is specified, the size box has the height, width, and position given in theCreatemember function. | 
| SBS_SIZEBOXBOTTOMRIGHTALIGN | Used with the SBS_SIZEBOXstyle. The lower-right corner of the size box is aligned with the lower-right corner of the rectangle specified in theCreatemember function. The size box has the default size for system size boxes. | 
| SBS_SIZEBOXTOPLEFTALIGN | Used with the SBS_SIZEBOXstyle. The upper-left corner of the size box is aligned with the upper-left corner of the rectangle specified in theCreatemember function. The size box has the default size for system size boxes. | 
| SBS_SIZEGRIP | Same as SBS_SIZEBOX, but with a raised edge. | 
| SBS_TOPALIGN | Used with the SBS_HORZstyle. The top edge of the scroll bar is aligned with the top edge of the rectangle specified in theCreatemember function. The scroll bar has the default height for system scroll bars. | 
| SBS_VERT | Designates a vertical scroll bar. If neither the SBS_RIGHTALIGNnorSBS_LEFTALIGNstyle is specified, the scroll bar has the height, width, and position given in theCreatemember function. | 
Static styles
Static styles apply to CStatic Class objects. Specify a combination of styles in the dwStyle parameter of CStatic::Create. For more information about static control styles in Windows, see Static Control Styles (Windows).
| Style | Description | 
|---|---|
| SS_BITMAP | Specifies a bitmap is to be displayed in the static control. The given text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap. | 
| SS_BLACKFRAME | Specifies a box with a frame drawn with the same color as window frames. The default is black. | 
| SS_BLACKRECT | Specifies a rectangle filled with the color used to draw window frames. The default is black. | 
| SS_CENTER | Designates a simple rectangle and displays the given text centered in the rectangle. The text is formatted before it is displayed. Words that would extend past the end of a line are automatically wrapped to the beginning of the next centered line. | 
| SS_CENTERIMAGE | Specifies that, if the bitmap or icon is smaller than the client area of the static control, the rest of the client area is filled with the color of the pixel in the top left corner of the bitmap or icon. If the static control contains a single line of text, the text is centered vertically in the client area of the control. | 
| SS_ENDELLIPSIS | or SS_PATHELLIPSISReplaces part of the given string with ellipsis, if necessary, so that the result fits in the specified rectangle.You can specify SS_END_ELLIPSISto replace characters at the end of the string, orSS_PATHELLIPSISto replace characters in the middle of the string. If the string contains backslash (\) characters,SS_PATHELLIPSISpreserves as much of the text after the last backslash as possible. | 
| SS_ENHMETAFILE | Specifies an enhanced metafile is to be displayed in the static control. The given text is the name of a metafile. An enhanced metafile static control has a fixed size; the metafile is scaled to fit the static control's client area. | 
| SS_ETCHEDFRAME | Draws the frame of the static control using the EDGE_ETCHEDedge style. | 
| SS_ETCHEDHORZ | Draws the top and bottom edges of the static control using the EDGE_ETCHEDedge style. | 
| SS_ETCHEDVERT | Draws the left and right edges of the static control using the EDGE_ETCHEDedge style. | 
| SS_GRAYFRAME | Specifies a box with a frame drawn with the same color as the screen background (desktop). The default is gray. | 
| SS_GRAYRECT | Specifies a rectangle filled with the color used to fill the screen background. The default is gray. | 
| SS_ICON | Designates an icon displayed in the dialog box. The given text is the name of an icon (not a filename) defined elsewhere in the resource file. The nWidthandnHeightparameters are ignored; the icon automatically sizes itself. | 
| SS_LEFT | Designates a simple rectangle and displays the given text flush-left in the rectangle. The text is formatted before it is displayed. Words that would extend past the end of a line are automatically wrapped to the beginning of the next flush-left line. | 
| SS_LEFTNOWORDWRAP | Designates a simple rectangle and displays the given text flush-left in the rectangle. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped. | 
| SS_NOPREFIX | Unless this style is specified, Windows will interpret any ampersand (&) characters in the control's text to be accelerator prefix characters. In this case, the ampersand is removed and the next character in the string is underlined. If a static control is to contain text where this feature is not wanted, SS_NOPREFIXmay be added. This static-control style may be included with any of the defined static controls. You can combineSS_NOPREFIXwith other styles by using the bitwise OR operator. This is most often used when filenames or other strings that may contain an ampersand need to be displayed in a static control in a dialog box. | 
| SS_NOTIFY | Sends the parent window STN_CLICKED,STN_DBLCLK,STN_DISABLE, andSTN_ENABLEnotification messages when the user clicks or double-clicks the control. | 
| SS_OWNERDRAW | Specifies that the owner of the static control is responsible for drawing the control. The owner window receives a WM_DRAWITEMmessage whenever the control needs to be drawn. | 
| SS_REALSIZEIMAGE | Prevents a static icon or bitmap control (that is, static controls that have the SS_ICONorSS_BITMAPstyle) from being resized as it is loaded or drawn. If the icon or bitmap is larger than the destination area, the image is clipped. | 
| SS_RIGHT | Designates a simple rectangle and displays the given text flush-right in the rectangle. The text is formatted before it is displayed. Words that would extend past the end of a line are automatically wrapped to the beginning of the next flush-right line. | 
| SS_RIGHTJUST | Specifies that the lower right corner of a static control with the SS_BITMAPor SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon. | 
| SS_SIMPLE | Designates a simple rectangle and displays a single line of text flush-left in the rectangle. The line of text cannot be shortened or altered in any way. (The control's parent window or dialog box must not process the WM_CTLCOLORmessage.) | 
| SS_SUNKEN | Draws a half-sunken border around a static control. | 
| SS_USERITEM | Specifies a user-defined item. | 
| SS_WHITEFRAME | Specifies a box with a frame drawn with the same color as the window background. The default is white. | 
| SS_WHITERECT | Specifies a rectangle filled with the color used to fill the window background. The default is white. | 
| SS_WORDELLIPSIS | Truncates text that does not fit and adds ellipsis. | 
Window styles
Window styles apply to CWnd Class objects. Specify a combination of styles in the dwStyle parameter of CWnd::Create or CWnd::CreateEx. For more information about window styles in Windows, see Window Styles (Windows).
| Style | Description | 
|---|---|
| WS_BORDER | Creates a window that has a border. | 
| WS_CAPTION | Creates a window that has a title bar (implies the WS_BORDERstyle). Cannot be used with theWS_DLGFRAMEstyle. | 
| WS_CHILD | Creates a child window. Cannot be used with the WS_POPUPstyle. | 
| WS_CHILDWINDOW | Same as the WS_CHILDstyle. | 
| WS_CLIPCHILDREN | Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window. | 
| WS_CLIPSIBLINGS | Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGSstyle clips all other overlapped child windows out of the region of the child window to be updated. (IfWS_CLIPSIBLINGSis not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with theWS_CHILDstyle only. | 
| WS_DISABLED | Creates a window that is initially disabled. | 
| WS_DLGFRAME | Creates a window with a double border but no title. | 
| WS_GROUP | Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUPstyleFALSEafter the first control belong to the same group. The next control with theWS_GROUPstyle starts the next group (that is, one group ends where the next begins). | 
| WS_HSCROLL | Creates a window that has a horizontal scroll bar. | 
| WS_ICONIC | Creates a window that is initially minimized. Same as the WS_MINIMIZEstyle. | 
| WS_MAXIMIZE | Creates a window of maximum size. | 
| WS_MAXIMIZEBOX | Creates a window that has a Maximize button. | 
| WS_MINIMIZE | Creates a window that is initially minimized. For use with the WS_OVERLAPPEDstyle only. | 
| WS_MINIMIZEBOX | Creates a window that has a Minimize button. | 
| WS_OVERLAPPED | Creates an overlapped window. An overlapped window usually has a caption and a border. | 
| WS_OVERLAPPEDWINDOW | Creates an overlapped window with the WS_OVERLAPPED,WS_CAPTION,WS_SYSMENU,WS_THICKFRAME,WS_MINIMIZEBOX, andWS_MAXIMIZEBOXstyles. | 
| WS_POPUP | Creates a pop-up window. Cannot be used with the WS_CHILDstyle. | 
| WS_POPUPWINDOW | Creates a pop-up window with the WS_BORDER,WS_POPUP, andWS_SYSMENUstyles. TheWS_CAPTIONstyle must be combined with theWS_POPUPWINDOWstyle to make the Control menu visible. | 
| WS_SIZEBOX | Creates a window that has a sizing border. Same as the WS_THICKFRAMEstyle. | 
| WS_SYSMENU | Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars. | 
| WS_TABSTOP | Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOPstyle. | 
| WS_THICKFRAME | Creates a window with a thick frame that can be used to size the window. | 
| WS_TILED | Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPEDstyle. | 
| WS_TILEDWINDOW | Creates an overlapped window with the WS_OVERLAPPED,WS_CAPTION,WS_SYSMENU,WS_THICKFRAME,WS_MINIMIZEBOX, andWS_MAXIMIZEBOXstyles. Same as theWS_OVERLAPPEDWINDOWstyle. | 
| WS_VISIBLE | Creates a window that is initially visible. | 
| WS_VSCROLL | Creates a window that has a vertical scroll bar. | 
Extended window styles
Extended window styles apply to CWnd Class objects. Specify a combination of styles in the dwExStyle parameter of CWnd::CreateEx. For more information about extended window styles in Windows, see Extended Window Styles (Windows).
| Style | Description | 
|---|---|
| WS_EX_ACCEPTFILES | Specifies that a window created with this style accepts drag-and-drop files. | 
| WS_EX_APPWINDOW | Forces a top-level window onto the taskbar when the window is visible. | 
| WS_EX_CLIENTEDGE | Specifies that a window has a 3D look — that is, a border with a sunken edge. | 
| WS_EX_CONTEXTHELP | Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELPmessage. | 
| WS_EX_CONTROLPARENT | Allows the user to navigate among the child windows of the window by using the TAB key. | 
| WS_EX_DLGMODALFRAME | Designates a window with a double border that may (optionally) be created with a title bar when you specify the WS_CAPTIONstyle flag in thedwStyleparameter. | 
| WS_EX_LAYERED | The window is a layered window. This style cannot be used if the window has a class style of either CS_OWNDCorCS_CLASSDC. However, Microsoft Windows 8 does support theWS_EX_LAYEREDstyle for child windows, where previous Windows versions support it only for top-level windows. | 
| WS_EX_LEFT | Gives window generic left-aligned properties. This is the default. | 
| WS_EX_LEFTSCROLLBAR | Places a vertical scroll bar to the left of the client area. | 
| WS_EX_LTRREADING | Displays the window text using left-to-right reading order properties. This is the default. | 
| WS_EX_MDICHILD | Creates an MDI child window. | 
| WS_EX_NOPARENTNOTIFY | Specifies that a child window created with this style will not send the WM_PARENTNOTIFYmessage to its parent window when the child window is created or destroyed. | 
| WS_EX_OVERLAPPEDWINDOW | Combines the WS_EX_CLIENTEDGEandWS_EX_WINDOWEDGEstyles | 
| WS_EX_PALETTEWINDOW | Combines the WS_EX_WINDOWEDGEandWS_EX_TOPMOSTstyles. | 
| WS_EX_RIGHT | Gives a window generic right-aligned properties. This depends on the window class. | 
| WS_EX_RIGHTSCROLLBAR | Places a vertical scroll bar (if present) to the right of the client area. This is the default. | 
| WS_EX_RTLREADING | Displays the window text using right-to-left reading order properties. | 
| WS_EX_STATICEDGE | Creates a window with a three-dimensional border style intended to be used for items that do not accept user input. | 
| WS_EX_TOOLWINDOW | Creates a tool window, which is a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB. | 
| WS_EX_TOPMOST | Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPosmember function to add or remove this attribute. | 
| WS_EX_TRANSPARENT | Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINTmessages only after all sibling windows beneath it have been updated. | 
| WS_EX_WINDOWEDGE | Specifies that a window has a border with a raised edge. | 
See also
MFC Class Overview
CWnd::Create
CWnd::CreateEx
CEdit::Create
CScrollBar::Create
CStatic::Create
AfxMessageBox
CreateWindow
CreateWindowEx
Button Styles (Windows)
Combo Box Styles (Windows)
Edit Control Styles (Windows)
List Box Styles (Windows)
MessageBox Function (Windows)
Scroll Bar Control Styles (Windows)
Static Control Styles (Windows)
Window Styles (Windows)
Extended Window Styles (Windows)