Microsoft Foundation Classes (mfc.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CEdit::Create
◄CEdit► ◄Up► ◄Contents► ◄Index► ◄Back►
──Microsoft Foundation Classes──────────────────────────────────────────────
BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID );
Parameter Description
<dwStyle> Specifies the edit control's ◄style►.
<rect> Specifies the edit control's size and position.
<pParentWnd> Specifies the edit control's parent window (usually a
CDialog or CModalDialog). It must not be NULL.
<nID> Specifies the edit control's ID.
Remarks
You construct a CEdit object in two steps. First, call the CEdit
constructor, then call Create, which creates the Windows edit control
and attaches it to the CEdit object.
When Create executes, Windows sends the ◄WM_NCCREATE►, ◄WM_NCCALCSIZE►,
◄WM_CREATE►, and ◄WM_GETMINMAXINFO► messages to the edit control.
These messages are handled by default by the ◄OnNcCreate►,
◄OnNcCalcSize►, ◄OnCreate►, and ◄OnGetMinMaxInfo► member functions in
the CWnd base class. To extend the default message handling, derive a
class from CEdit, add a message map to the new class, and override the
above message-handler member functions. Override OnCreate, for example,
to perform needed initialization for the new class.
To handle Windows notification messages sent from a CEdit object to its
parent, add the following message-map entries to the parent class
message map:
ON_COMMAND
ON_EN_SETFOCUS
ON_EN_KILLFOCUS
ON_EN_MAXTEXT
ON_EN_CHANGE
ON_EN_UPDATE
ON_EN_HSCROLL
ON_EN_VSCROLL
Apply the following ◄window styles► to an edit control:
Style Application
WS_CHILD Always.
WS_VISIBLE Usually.
WS_DIABLED Rarely.
WS_GROUP To group controls.
WS_TABSTOP To include edit control in the tabbing order.
Apply any combination of ◄edit styles► to the edit control.
Return Value
Create returns TRUE if initialization is successful; FALSE if
unsuccessful.
See Also
◄CEdit::CEdit►
-♦-