2
有没有在流文档或system.windows.control RichTextBox(wpf)中创建挂起缩进的方法?如果它能在流程文档中工作,当我将它加载到RichTextBox中以显示它时,它会保持它的形式吗?在流文档或WPF RichTextBox中创建挂入缩进
有没有在流文档或system.windows.control RichTextBox(wpf)中创建挂起缩进的方法?如果它能在流程文档中工作,当我将它加载到RichTextBox中以显示它时,它会保持它的形式吗?在流文档或WPF RichTextBox中创建挂入缩进
在FlowDocument段落中,您可以将左边距设置为悬挂缩进值,然后将TextIndent设置为该值的负值。下面是一个例子:在这里缩进WPF Documents - Indenting Paragraphs
希望这有助于
<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>
更多的细节,关于