Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在流文档或WPF RichTextBox中创建挂起缩进_C#_Wpf_Richtextbox_Flowdocument_Indentation - Fatal编程技术网

C# 在流文档或WPF RichTextBox中创建挂起缩进

C# 在流文档或WPF RichTextBox中创建挂起缩进,c#,wpf,richtextbox,flowdocument,indentation,C#,Wpf,Richtextbox,Flowdocument,Indentation,是否有方法在流文档或system.windows.control RichTextBox(wpf)中创建挂起缩进?如果它能在流程文档中工作,当我将其加载到RichTextBox中显示时,它会保持其形式吗?在流程文档段落中,您可以将左边距设置为悬挂缩进值,然后将文本缩进设置为该值的负数。以下是一个例子: <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefini

是否有方法在流文档或system.windows.control RichTextBox(wpf)中创建挂起缩进?如果它能在流程文档中工作,当我将其加载到RichTextBox中显示时,它会保持其形式吗?

在流程文档段落中,您可以将左边距设置为悬挂缩进值,然后将文本缩进设置为该值的负数。以下是一个例子:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>

    <FlowDocumentScrollViewer>
        <FlowDocument>
            <Section>
                <Paragraph TextIndent="-30" Margin="30,20,0,0">
                    The first line of this paragraph is not indented, but the rest of the lines will be indented by 30 units. The first line of this paragraph is not indented, but the rest of the lines will be indented by 30 units.
                </Paragraph>
            </Section>
        </FlowDocument>
    </FlowDocumentScrollViewer>

    <RichTextBox Grid.Row="1">
        <FlowDocument>
            <Section>
                <Paragraph TextIndent="-60" Margin="60,20,0,0">
                    The first line of this paragraph is not indented, but the rest of the lines will be indented by 60 units. The first line of this paragraph is not indented, but the rest of the lines will be indented by 60 units.
                </Paragraph>
            </Section>
        </FlowDocument>
    </RichTextBox>
</Grid>

本段第一行不缩进,但其余行将缩进30个单位。本段第一行不缩进,但其余行将缩进30个单位。
本段第一行不缩进,但其余行将缩进60个单位。本段第一行不缩进,但其余行将缩进60个单位。
这里有更多关于缩进的详细信息

希望这有帮助,谢谢