1

I cannot find how to set horizontal character spacing in a RichTextBox.

Hello, World! H e l l o , W o r l d !


I can only set vertical Line Height using C#.

Paragraph p = new Paragraph();
p.LineHeight = 50;

rtb1.Document = new FlowDocument(p);

p.Inlines.Add(new Run("Hello, World!"));

And outer margin with XAML.

<RichTextBox x:Name="rtb1" 
       HorizontalAlignment="Left"
       Height="600"
       Width="300" 
       Margin="188,61,0,0" 
       VerticalAlignment="Top">
     <RichTextBox.Resources>
         <Style TargetType="{x:Type Paragraph}">
             <Setter Property="Margin" Value="50"/>
         </Style>
     </RichTextBox.Resources>
 </RichTextBox>
Matt McManis
  • 4,475
  • 5
  • 38
  • 93

1 Answers1

0

The most common options you have are:

but here on SO a user found a nice (although potentially performance intensive) alternative to both (read the accepted answer):

How can I specify letter spacing or kerning, in a WPF TextBox?

Tommaso Belluzzo
  • 23,232
  • 8
  • 74
  • 98