Using Rich Edit Controls
This section contains topics that demonstrate how to create and use rich edit controls.
In this section
| Topic | Description |
|---|---|
|
To create a rich edit control, call the CreateWindowEx function, specifying the rich edit window class. For Microsoft Rich Edit 4.1 (Msftedit.dll), specify MSFTEDIT_CLASS as the window class. For all previous versions, specify RICHEDIT_CLASS. For more information, see Versions of Rich Edit. Rich edit controls support most of the window styles used with edit controls as well as additional styles. You should specify the ES_MULTILINE window style if you want to allow more than one line of text in the control. For more information, see Rich Edit Control Styles. | |
|
An application can send messages to a rich edit control in order to format characters and paragraphs and retrieve formatting information. Paragraph formatting attributes include alignment, tabs, indents, numbering, and simple tables. For characters, you can specify font name, size, color, and effects such as bold, italic, and protected. | |
|
The user can select text in a rich edit control by using the mouse or the keyboard. The current selection is the range of selected characters, or the position of the insertion point if no characters are selected. An application can get information about the current selection, set it, determine when it changes, and show or hide the selection highlight. | |
|
An application can send messages to retrieve or find text in a rich edit control. You can retrieve either the selected text or a specified range of text. | |
|
A rich edit control calls a function called a word-break procedure to find breaks between words and to determine where it can break lines. The control uses this information when performing word-wrap operations and when processing CTRL+LEFT ARROW key and CTRL+RIGHT ARROW key combinations. An application can send messages to a rich edit control to replace the default word-break procedure, to retrieve word-break information, and to determine what line a given character falls on. | |
|
An application can paste the contents of the clipboard into a rich edit control by using either the best available clipboard format or a specific clipboard format. You can also determine whether a rich edit control is capable of pasting a clipboard format. | |
|
You can use streams to transfer data into or out of a rich edit control. A stream is defined by an EDITSTREAM structure, which specifies a buffer and an application-defined callback function. | |
|
An application can resize a rich edit control as needed so that it is always the same size as its contents. A rich edit control supports this so-called bottomless functionality by sending its parent window an EN_REQUESTRESIZE notification code whenever the size of the control's content changes. | |
|
A rich edit control's parent window can process notification codes to monitor events that affect the control. Rich edit controls support all of the notification codes that are used with edit controls, as well as several additional ones. | |
|
Microsoft Rich Edit 3.0 assigns a character set to plain-text characters depending on their context. Some examples are:
| |
|
This section contains information about using object linking and embedding (OLE) in rich edit controls. | |
|
This section contains information about how to print the contents of rich edit controls. |
Send comments about this topic to Microsoft
Build date: 10/27/2012