Anyone has a snippet on inserting lines of texts into a multi-row CEdit?
The CEdit only provides API for extracting, but seems to forget about inserting.
Printable View
Anyone has a snippet on inserting lines of texts into a multi-row CEdit?
The CEdit only provides API for extracting, but seems to forget about inserting.
use SetSel() followed by ReplaceSel()
/* "Give me a decent hash-function to stand on, and I will move the earth." -Archimedes */
[email protected]
A couple of methods :
CString str;
m_edit_control.GetWindowText(str);
str += "new line \r\n";
m_edit_control.SetWindowText(str);
Another method :
m_edit_controSetSel(m_edit_control.GetWindowTextLength(),-1);
m_edit_control.ReplaceSel("new line \r\n");