I am working on WPF, i am display RichText data in RichTextBox for that have taken WindowsFormHost, inside that i am taking WinForm RichTextBox to display RichTextData which
You can use BaselineAlignment
on a Run
to center align the text. Here is an example:
EDIT:
To apply the formatting to the entire RichTextBox
try calling this method after the RichTextBox
is populated:
public void CenterText()
{
var text = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
text.ApplyPropertyValue(Inline.BaselineAlignmentProperty, BaselineAlignment.Center);
}