共用方式為


CRichEditCtrl Class

Provides the functionality of the rich edit control.

class CRichEditCtrl : public CWnd

Remarks

A "rich edit control" is a window in which the user can enter and edit text. The text can be assigned character and paragraph formatting, and can include embedded OLE objects. Rich edit controls provide a programming interface for formatting text. However, an application must implement any user interface components necessary to make formatting operations available to the user.

This Windows Common control (and therefore the CRichEditCtrl class) is available only to programs running under Windows 95/98 and Windows NT versions 3.51 and later. The CRichEditCtrl class supports versions 2.0 and 3.0 of the Windows SDK rich edit control.

警告

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.

For more information on using CRichEditCtrl, see:

  • Controls

  • Using CRichEditCtrl

  • Knowledge Base article Q259949 : INFO: SetCaretPos() Is Not Appropriate with CEdit or CRichEditCtrl Controls

For an example of using a rich edit control in an MFC application, see the WORDPAD sample application.

Requirements

Header: afxcmn.h

See Also

Concepts

WORDPAD Sample: The Windows Application

CRichEditCtrl Members

CWnd Class

Hierarchy Chart

CEdit Class

CRichEditView Class