Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change RichTextBox paragraph spacing?

I am using a RichTextBox in WPF, and am trying to set the default paragraph spacing to 0 (so that there is no paragraph spacing). While I could do this in XAML, I would like to achieve it programmatically if possible. Any ideas?

like image 560
Darren Oster Avatar asked Nov 28 '08 04:11

Darren Oster


Video Answer


1 Answers

I did it with style (pun indented)

<RichTextBox  Margin="0,51,0,0" Name="mainTextBox" >         <RichTextBox.Resources>             <Style TargetType="{x:Type Paragraph}">                 <Setter Property="Margin" Value="0"/>             </Style>         </RichTextBox.Resources>     </RichTextBox> 
like image 180
moogs Avatar answered Sep 21 '22 05:09

moogs