Applies to

RichTextEdit controls


WordWrap determines how a rich text control displays large blocks of text that do not contain spaces or other word-breaking characters (tab characters or end-of-line markers, but not hyphens). If the last word in a block of text is too large to fit on a line when WordWrap is enabled, the rich text control splits the word and displays the nonfitting characters on the following line.

When WordWrap is disabled, users cannot enter characters (other than word-breaking characters) beyond the right margin, and must move the cursor to a new line to continue entering text. If a document is inserted when WordWrap is disabled, and the document conatins a block of text too large to fit on a line, the rich text control hides the nonfitting characters, even when the text eventually breaks to a new line because of a space or other word-breaking character. .

WordWrap can be enabled or disabled by the user at runtime from the Properties item on the pop-up menu when the PopMenu property is enabled. If characters from an inserted text are hidden because WordWrap is disabled, and the user subsequently enables WordWrap, the hidden characters will be displayed on the next line of the rich text control. If the same text is inserted when WordWrap is enabled, and the user subsequently disables WordWrap, the rich text control hides previously visible characters that had wrapped to the next line.


In a painter

To enable word wrap:

  • Select the WordWrap check box on the Document tab page of the control's Properties view.

In scripts

The WordWrap property takes a boolean value.

The following line enables word wrapping for a RichTextEdit control:

rte_1.WordWrap = TRUE