The information in this article applies to:
SUMMARYControls placed in a dialog box under Windows 95 have a 3D border. If you want to create a control at run time that has a 3D border, specify the WS_EX_CLIENTEDGE extended style. MORE INFORMATION
The new extended-window style WS_EX_CLIENTEDGE specifies that a window is
to have a 3D border. All controls created by the dialog manager are created
with that style automatically added. To create a control at run time that
has a 3D border, you have to add that style yourself.
Here m_Edit is a CEdit object, pParent is a pointer to a parent window, and
nID is an ID of an edit control. To add a 3D border, create control by
using this code:
NOTE: While Visual C++ versions 2.2 and above define WS_EX_CLIENTEDGE in
WINUSER.H, Visual C++ version 2.1 does not. Therefore, if you're using
version 2.1, you must include the following definition in your code:
If you're using Visual C++ versions 2.2 and above, the WS_EX_CLIENTEDGE
constant is automatically defined when you include AFXWIN.H, so no
additional work is necessary.Keep in mind that the WS_EX_CLIENTEDGE style applies to any window, not just controls. In Visual C++ versions 2.2 and above, MFC automatically adds WS_EX_CLIENTEDGE for frames and views but not for CWnd-based windows or controls. To create other standard controls, you have to specify their pre-defined Windows class name: BUTTON, COMBOBOX, LISTBOX, SCROLLBAR, or STATIC. REFERENCES
For more information about Create and CreateEx, please see the Class
Library Reference in Books Online. Additional query words: kbinf 3D border sunken 2.10 2.20 4.00 runtime run-time
Keywords : kbMFC KbUIDesign kbVC |
Last Reviewed: September 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |