Create Rich Text Controls

XML Forms Guide

Version
R2024.1.1
Create Rich Text Controls

Rich text controls allow you to customize the font face, size, weight, color, style, alignment, and other attributes of the text displayed on a form.

You can create rich text controls using the <RichTextControl> tag.

Copy
<RichTextControl>
    <Block>1</Block>
    <Row>1</Row>
    <RowSpan>8</RowSpan>
    <Column>0</Column>
    <ColumnSpan>3</ColumnSpan>
    <Caption>
        <Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xml:space="preserve" HasTrailingParagraphBreakOnPaste="False">
            <Paragraph FontSize="10" 
                    FontFamily="Portable User Interface" 
                    Foreground="#FF000000" 
                    FontWeight="Normal" 
                    FontStyle="Normal" 
                    FontStretch="Normal" 
                    TextAlignment="Left">
                <Run Foreground="#FF000000" 
                    FontWeight="Bold" 
                    Text="Text 1" />
                <Run Foreground="#FF0000FF" 
                    Text="Text 2" />
            </Paragraph>
        </Section>
    </Caption>
</RichTextControl>

Rich text controls use the <Block>, <Row>, <RowSpan>, <Column>, and <ColumnSpan> tags that are available in other controls.

There can only be one <Caption> tag and one <Section> tag used on a form. Multiple <Paragraph> tags can be defined within a <Section> tag, to allow you to group run tags into multiple paragraphs. Each paragraph is separated by a line break. Each <Section> tag can also have multiple <Run> tags defined within it, to allow you to have multiple text formats within a paragraph.

Properties that can be applied to <Paragraph> and <Run> tags
Attribute Used By Possible Values Default Value
FontSize Both Any positive, non-decimal, integer value 10
FontFamily Both

Arial

Arial Black

Calibri

Comic Sans MS

Courier New

Georgia

Lucida Sans Unicode

Portable User Interface

Times New Roman

Trebuchet MS

Verdana

Times New Roman
Foreground Both

Black

Red

Blue

Green

Yellow

Black
FontWeight Both

Black

Bold

ExtraBlack

ExtraBold

ExtraLight

Light

Medium

Normal

SemiBold

Thin

Normal
FontStyle Both

Italic

Normal

Normal
FontStretch Both

Condensed

Expanded

ExtraCondensed

ExtraExpanded

Normal

SemiCondensed

SemiExpanded

UltraCondensed

UltraExpanded

Normal
TextAlignment Both

Center

Justified

Left

Right

Left
TextDecorations Run Underline Underline
Text Run Any text content. If no values are provided, the form will contain empty text.  

If a property is applied to a paragraph, all of the <Run> tags inherit the formatting, by default. If a <Run> tag has properties applied to it, the formatting overrides the properties defined in the <Paragraph> tag, by default.