用基类的SetWindowText。 MSDN : To set and retrieve text ,use the CWnd member functions SetWindowText and GetWindowText, which set or get the entire contents of an edit control, even if it is a multiline control. CEditView使用的是编辑控件提供多行文本操作。你能在编辑控件里面使用TextOut()吗?
CEditView 就要充分发挥 Edit 的优势!void TextOut(CString strOut) { int len = GetWindowTextLength(); GetEditCtrl().SetSel(len,len); GetEditCtrl().ReplaceSel("\r\n", TRUE); GetEditCtrl().SetSel(len , len ); GetEditCtrl().ReplaceSel(strOut, TRUE); }
MSDN :
To set and retrieve text ,use the CWnd member functions SetWindowText and GetWindowText, which set or get the entire contents of an edit control, even if it is a multiline control.
CEditView使用的是编辑控件提供多行文本操作。你能在编辑控件里面使用TextOut()吗?
{
int len = GetWindowTextLength(); GetEditCtrl().SetSel(len,len);
GetEditCtrl().ReplaceSel("\r\n", TRUE);
GetEditCtrl().SetSel(len , len );
GetEditCtrl().ReplaceSel(strOut, TRUE);
}
不是在CMyEditView::OnDraw()函数中么?