您的位置:首页 > 编程语言 > C语言/C++

【C++】创建动态的文本编辑框

2016-02-25 10:19 281 查看
CRect oRect;
this->GetClientRect(oRect);

int nWidth=oRect.Width();
int nHeigth=oRect.Height();

m_cRTemp1.SetRect(0,nHeigth*3/4,nWidth/2,nHeigth);
m_cRTemp2.SetRect(nWidth/2,nHeigth*3/4,nWidth,nHeigth);

if (m_edit1)
{
delete m_edit1;
}
if (m_edit2)
{
delete m_edit2;
}

CEdit m_edit1,m_edit2;

m_edit1=new CEdit();
m_edit2=new CEdit();

m_edit1->Create(WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | 1, m_cRTemp1, this, IDS_STRINGCURVE1 );
m_edit2->Create(WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | 1, m_cRTemp2, this, IDS_STRINGCURVE2 );

//设为只读文本框
m_edit1->SetReadOnly();
m_edit2->SetReadOnly();



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: