Chapter Five: Rich Edit Controls

Single-line edit controls are nice. Multiline edit controls are nicer. But rich edit controls are the nicest of all. At its simplest, a rich edit control is a window in which a user can both enter and edit text. But that's not all. Just as a multiline edit control provides a programming interface for entering and editing multiple lines of text, a rich edit control provides a programming interface for formatting text. With this new Microsoft Windows 95 common control, a user can assign both character and paragraph formatting (making words boldface or italic, adding underlining, or realigning paragraphs, for instance) and can include embedded OLE objects in the text.

To make these formatting operations available to the user, an application must implement the necessary user interface components. For example, if you want to let the user format selected characters as boldface in a rich edit control, your application must provide a mechanism to do this, such as a toolbar button or a menu item.

Rich edit controls are based on multiline edit controls, and they support almost all the messages and notifications used with multiline edit controls. (A list near the end of this chapter specifies messages that are not supported.) If your application already includes single-line or multiline edit controls, you can easily change it to use rich edit controls, and thus incorporate their unique functionality.