Using the RichTextEdit control

You can add a RichTextEdit control to a window to enhance your application with word processing capabilities.

Users can enter text in a RichTextEdit control, format it, save it to a file, and print it. You can also enable a pop-up menu from which users can control the appearance of the control and import documents.

StepsTo add a RichTextEdit control to a window:

  1. In the Window painter, select Insert>Control>RichTextEdit and click the window.

Controlling the appearance of a RichTextEdit control

You modify the appearance of a RichTextEdit control by setting its properties. Some of the properties you can set are:

StepsTo control the appearance of a RichTextEdit control:

  1. Select the control, then select the Document tab in the Properties view.

  2. Choose the appropriate properties to display toolbars.

  3. Choose the appropriate properties if you want to display nonprinting characters such as tabs, spaces, and returns.

    For information about other options on the Document properties page, select Help from the property page’s pop-up menu.

Making a RichTextEdit control read-only

There are times when you might want to import a file into the RichTextEdit control and not give the user the opportunity to alter it. You can make a control read-only by setting the Enabled and Popup Menu properties.

StepsTo make a RichTextEdit control read-only:

  1. Select the control, then select the General tab in the Properties view.

  2. Make sure the Enabled check box is cleared.

  3. Select the Document tab.

  4. Make sure the PopMenu check box is cleared.

Enabling the pop-up menu

If you enable the pop-up menu property, users can customize the appearance of the RichTextEdit control.

From the pop-up menu, users can:

For more information about the RichTextEdit control, see the chapter on implementing rich text in Application Techniques.