[]
        
(Showing Draft Content)

Format Text

Editor provides options for formatting XHTML documents and their elements through the commands and style options available in EditorRibbon.

Align text

Use the alignment commands in the Paragraph group of EditorRibbon to configure paragraph alignment.

C1WinForms RichTextEditor paragraph alignment commands

The following image shows document text with different alignment settings.

C1WinForms RichTextEditor paragraph alignment commands demo

Note: Content aligns left by default.


Decorate Text

Use the FindAndDecorate method of the C1Editor class to apply style attributes to text that matches a specified pattern.

The pattern can contain plain text or a regular expression. Style attributes can configure the background color, foreground color, and other formatting properties. Separate multiple style declarations with semicolons.

For example, matching occurrences of a name can be displayed with a blue background and beige text.

c1Editor1.FindAndDecorate("Nikola", null, "background-color:blue; color:beige;");

C1WinForms RichTextEditor paragraph decorate text demo

Use the Styles group in EditorRibbon to perform the following actions:

  • Apply a predefined style.

  • Create a custom style by selecting Create New Style from Formatting.

  • Remove applied formatting by selecting Clear All Formatting.

The following image shows the predefined style options available in EditorRibbon.

C1WinForms RichTextEditor paragraph decorate text styles