不用自己设计了,伤脑细胞的,vc为你写了个编辑器了。创建一个单文档程序,继承ceditview即可在加入onopendocumentboolccpptexteditdoc::onopendocument(lpctstrlpszpathname){if(!cdocument::onopendocument(lpszpathname))returnfalse;cstdiofiletxtfile;pen(lpszpathname,cfile::moderead);if(_hfile==invalid_handle_value){afxmessagebox(text("文件无效"));}cstringstrread,strtemp;while(adstring(strtemp))strread+=strtemp;lose();reinterpret_cast(m_head())->setwindowtext(buffer());returntrue;}