none
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):

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

     

    <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

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

    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.

     

    rediculious,why......

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