EM_SETTEXTMODE message

Sets the text mode or undo level of a rich edit control. The message fails if the control contains any text.

Parameters

wParam

One or more values from the TEXTMODE enumeration type. The values specify the new settings for the control's text mode and undo level parameters.

Specify one of the following values to set the text mode parameter. If you do not specify a text mode value, the text mode remains at its current setting.

Value Meaning
TM_PLAINTEXT Indicates plain text mode, in which the control is similar to a standard edit control. For more information about plain text mode, see the following Remarks section.
TM_RICHTEXT Indicates rich text mode, in which the control has standard rich edit functionality. Rich text mode is the default setting.

 

Specify one of the following values to set the undo level parameter. If you do not specify an undo level value, the undo level remains at its current setting.

Value Meaning
TM_SINGLELEVELUNDO The control allows the user to undo only the last action that can be undone.
TM_MULTILEVELUNDO The control supports multiple undo operations. This is the default setting. Use the EM_SETUNDOLIMIT message to set the maximum number of undo actions.

 

Specify one of the following values to set the code page parameter. If you do not specify an code page value, the code page remains at its current setting.

Value Meaning
TM_SINGLECODEPAGE The control only allows the English keyboard and a keyboard corresponding to the default character set. For example, you could have Greek and English. Note that this prevents Unicode text from entering the control. For example, use this value if a Rich Edit control must be restricted to ANSI text.
TM_MULTICODEPAGE The control allows multiple code pages and Unicode text into the control. This is the default setting.

 

lParam

This parameter is not used; it must be zero.

Return value

If the message succeeds, the return value is zero.

If the message fails, the return value is a nonzero value.

Remarks

In rich text mode, a rich edit control has standard rich edit functionality. However, in plain text mode, the control is similar to a standard edit control:

  • The text in a plain text control can have only one format (such as Bold, 10pt Arial).
  • The user cannot paste rich text formats, such as Rich Text Format (RTF) or embedded objects into a plain text control.
  • Rich text mode controls always have a default end-of-document marker or carriage return, to format paragraphs. Plain text controls, on the other hand, do not need the default, end-of-document marker, so it is omitted.

The control must contain no text when it receives the EM_SETTEXTMODE message. To ensure there is no text, send a WM_SETTEXT message with an empty string ("").

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Richedit.h
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值