How to set distance between paragraphs in richTextBox ?

All replies

  • You can use a Margin on a paragraph as one technique (either inline or as a style):

        <Paragraph>Paragraph 1</Paragraph>
        <Paragraph Margin="0,140,0,0">Paragraph 2</Paragraph>
    Thursday, June 14, 2007 1:16 PM
  • Set the margin as a style to get consistent spacing across all paragraphs.


    <FlowDocument xmlns="" xmlns:x="">

                <Style TargetType="{x:Type Paragraph}">
                     <Setter Property="Margin" Value="0,140,0,0"/>
           <Paragraph>Paragraph 1</Paragraph>
           <Paragraph>Paragraph 2</Paragraph>   

    Thursday, June 14, 2007 10:08 PM
  • yeah,thanks.but then the the text_content won't reveal in the richtext box.however define the margin in C# works well.



    Friday, June 15, 2007 1:31 AM
  • It won't 'reveal'? What do you mean?
    Friday, June 15, 2007 12:15 PM