中易网

Creat 中 CRect(0,0,0,0)含义

答案:4  悬赏:10  
解决时间 2021-02-28 12:20
例如:m_myedit.Creat(WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_CSROLLBAR1)); 中CRect(0,0,0,0)的作用???
望各位高手不吝赐教,由于只有10分,所以只能悬赏10分,还望见谅。
最佳答案
创建一个矩形。这里创建的空间你应该看不到。因为大小是0
坐标是(0,0,0,0)
全部回答
指定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); }
CRect(0,0,0,0)描述编辑框的位置和大小,一般是left,top,right,bottom4个参数,分别代表矩形的左,上,右,下的坐标 再看看别人怎么说的。
你的程序不对哦,应该是Create把 CRect(0,0,0,0),就是一左上角为坐标远点,以点(0,0)和(0,0)建立矩形
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
天津艺虹印刷发展有限公司属于什么性质企业
日租房相关手续
金丝猫鱼是冷水鱼还是热带鱼,耐低温吗?饲养
请问大石桥市汽车客运站圣通长途客运分站客服
如何发布高质量外链接
想去外企工作英语需要达到什么水平?需要考那
怎样不让好友知道我在斗地主
以斯帖酒店怎么去啊,有知道地址的么
滇西应用技术大学昆明有招生办吗?
飞智手柄菜单是哪个键
请问现在有没有从常州到宿迁的火车?
甲基橙变黄色,肯定存在的离子是什么?
代收代支怎么做帐
外墙涂料刷底一遍,面两遍,多少钱一平方
伟业铝材凤山总经销地址在哪,我要去那里办事
推荐资讯
遥观华民货运部这个地址在什么地方,我要处理
哪些网游有拿双刀/双剑的职业?
石塘镇地址有知道的么?有点事想过去
AUTOCAD2007中,求不当操作出现致命错误后,
稀土高新区少儿活动中心在哪里啊,我有事要去
三国全面战争哪个版本好玩?
离婚调解协议书一方拿走另一方没拿.但是签字
怎么样获得泛型T的Class对象
[讨论]请问中山大学的管理学是用哪本教材的?
WORD怎么使打的字竖排居左?
藏头诗(祝杨华英生日快乐)
关于华中师范大学转专业问题
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?