VC++ CEdit

CEDIT

_1, //selection

pEdit1->SetSel(0,strBuffer - m_strInput,0);

pEdit1->SetFocus(); //the selected will be highlighted

_2,   //comment filtern

strBuffer = m_strInput.SpanExcluding(";");

strComment = m_strInput.Right(m_strInput.GetLength()-strBuffer.GetLength());

m_strInput = strBuffer; 

_3,   CString to char *

l = m_strInput.GetLength();

Char * pcBuf = new char[l];

strcpy( pcBuf, (LPCTSTR)m_strInput); 

_4, when the edit window is not enough for output, scroll to the bottom make it visible

//get number of lines in edit box

i = pEdit->GetLineCount();

//scroll to bottom of box 

pEdit->LineScroll(i,0);

1,当字符串字符太长时候,用string table 资源,定义一个字符串,从而可以给edit text 赋值

m_strHelp.LoadString(IDS_HELP);

原文地址:https://www.cnblogs.com/aprilapril/p/3236491.html