CRichEditCtrl::SetReadOnly

Changes the ECO_READONLY option for this CRichEditCtrl object.

BOOL SetReadOnly( 
   BOOL bReadOnly = TRUE  
);

Parameters

  • bReadOnly
    Indicates if this CRichEditCtrl object should be read only.

Return Value

Nonzero if successful; otherwise, 0.

Remarks

For a brief description of this option, see SetOptions. You can use this function to set all the options for this CRichEditCtrl object.

For more information, see EM_SETREADONLY in the Windows SDK.

Example

// Set the rich edit control to be read-only.
m_myRichEditCtrl.SetReadOnly(TRUE);
ASSERT(m_myRichEditCtrl.GetStyle() & ES_READONLY);

Requirements

Header: afxcmn.h

See Also

Reference

CRichEditCtrl Class

Hierarchy Chart

CRichEditCtrl::Create

CRichEditCtrl::SetOptions