Center Justify paragraph in RichTextBox

Viewed 10898

I use a RichTextBox, and I want to format all the lines in a paragraph with justify alignment, except the last line will be aligned to the center.

as this:

      sssssssssssssssssssssssss
      sssssssssssssssssssssssss
      sssssssssssssssssssssssss
           ssssssssssssss     

I use this code for justify alignment.

2 Answers
<RichTextBox>
            <FlowDocument>
                <Paragraph TextAlignment="Justify">
                    sssssssssssssssssssssssss
                    sssssssssssssssssssssssss
                    sssssssssssssssssssssssss
                </Paragraph>
                <Paragraph TextAlignment="Center">
                    sssssssssssssssssssssssss
                </Paragraph>
            </FlowDocument>
</RichTextBox>

Mainly using Paragraph TextAlignment will give you the option to align the text: 1. Justify, 2. Center, 3. Left, 4. Right;

Related