Help Center

CRichEdit.SetReadOnlymethod

Sets or removes the read-only style (ES_READONLY) of a rich edit control.

Windowsmethoddocumented

Syntax

FUNCTION SetReadOnly (BYVAL hRichEdit AS HWND, BYVAL fReadOnly AS LONG) AS LONG

Parameters

NameDescription
hRichEditThe handle of the rich edit control.
fReadOnlySpecifies whether to set or remove the ES_READONLY style. A value of TRUE sets the ES_READONLY+* style; a value of **FALSE removes the ES_READONLY style.

Return value

If the operation succeeds, the return value is nonzero.

If the operation fails, the return value is zero.

Description

Sets or removes the read-only style (ES_READONLY) of a rich edit control.

Remarks

When an edit control has the ES_READONLY style, the user cannot change the text within the edit control.

To determine whether an edit control has the ES_READONLY style, use the Windows API GetWindowLong function with the GWL_STYLE flag.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later.

Reference

  • Defined in AfxNova/CRichEdit.inc:1151
  • Documented in Windows/WIndows Controls/CRichEdit Class.md
  • Topic: CRichEdit Class