Creat 中 CRect(0,0,0,0)含义 creat是什么意思

creat rife ehjoylife\u4ec0\u4e48\u610f\u601d

creat rife ehjoy life
\u521b\u9020\u6d41\u884c\u4eab\u53d7\u751f\u6d3b

creat
N.\u7a7f\u5fc3\u83b2.

指定edit框的位置及大小,CRect(orgX, orgY, width, hight)将edit的框位置设置为:左上角顶点(orgX,orgY),右下角顶点(orgX+width, orgY+hight).

另附上MSDN的说明:
CEdit::Create
BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );

Return Value

Nonzero if initialization is successful; otherwise 0.

Parameters

dwStyle

Specifies the edit control’s style. Apply any combination of edit styles to the control.

rect

Specifies the edit control’s size and position. Can be a CRect object or RECT structure.

pParentWnd

Specifies the edit control’s parent window (usually a CDialog). 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 theWM_NCCREATE,WM_NCCALCSIZE,WM_CREATE, andWM_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.

Apply the following window styles to an edit control.

WS_CHILD Always

WS_VISIBLE Usually

WS_DISABLED Rarely

WS_GROUP To group controls

WS_TABSTOP To include edit control in the tabbing order
Example

void CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();

// dynamically create an edit control on the view
CEdit* pEdit = new CEdit;
pEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(10, 10, 100, 100), this, 1);
}

创建一个矩形。这里创建的空间你应该看不到。因为大小是0
坐标是(0,0,0,0)

CRect(0,0,0,0)描述编辑框的位置和大小,一般是left,top,right,bottom4个参数,分别代表矩形的左,上,右,下的坐标

你的程序不对哦,应该是Create把
CRect(0,0,0,0),就是一左上角为坐标远点,以点(0,0)和(0,0)建立矩形

扩展阅读:code2790057小奶猫 ... creatures 中文翻译 ... creative ... 在线翻译英译汉 ... creator 中文翻译 ... cream发音 ... coherent ... achievement ... create是什么意思 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网