Help Center

RichEdit_SetReadOnlyfunction

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

Windowsfunctiondocumented

Syntax

FUNCTION RichEdit_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/AfxRichEdit.inc:966
  • Documented in Windows/WIndows Controls/RichEdit/RichEdit Procedures.md
  • Topic: RichEdit Procedures