谢谢 xing_xing_xing(ζ未名ζ) 的答复,可以运行了,这是我的代码: CTestDialogApp::CTestDialogApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance AfxInitRichEdit(); }不过运行之后RichEdit中的内容不能换行(粘贴都只能粘贴第一行),不知为何?
Caution If you are using a rich edit control in a dialog box (regardless whether your application is SDI, MDI, or dialog-based), you must call AfxInitRichEdit once before the dialog box is displayed. A typical place to call this function is in your program's InitInstance member function. You do not need to call it for each time you display the dialog box, only the first time. You do not have to call AfxInitRichEdit if you are working with CRichEditView
::AfxInitRichEdit();或
::AfxInitRichEdit2();
CTestDialogApp::CTestDialogApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
AfxInitRichEdit();
}不过运行之后RichEdit中的内容不能换行(粘贴都只能粘贴第一行),不知为何?
::AfxInitRichEdit();
还是delphi好!
RichEdit控件右键属性:
1.Multiline属性勾上
2.Auto HScroll属性勾去掉(去掉水平滚动)
3.Auto VScroll属性勾上(加上垂直滚动)
再不行的话,我弃VC从Delphi...
If you are using a rich edit control in a dialog box (regardless whether your application is SDI, MDI, or dialog-based), you must call AfxInitRichEdit once before the dialog box is displayed. A typical place to call this function is in your program's InitInstance member function. You do not need to call it for each time you display the dialog box, only the first time. You do not have to call AfxInitRichEdit if you are working with CRichEditView