mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-06 07:56:06 +02:00
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
21 lines
1.7 KiB
Markdown
21 lines
1.7 KiB
Markdown
---
|
|
title: "How to: Adjust Spacing Between Paragraphs"
|
|
ms.date: "03/30/2017"
|
|
helpviewer_keywords:
|
|
- "spacing between paragraphs [WPF]"
|
|
- "paragraphs [WPF], spacing between"
|
|
- "documents [WPF], adjusting spacing between paragraphs"
|
|
ms.assetid: 7cd2f2ac-0e19-4587-bfb6-7f5b18c9536e
|
|
---
|
|
# How to: Adjust Spacing Between Paragraphs
|
|
This example shows how to adjust or eliminate spacing between paragraphs in flow content.
|
|
|
|
In flow content, extra space that appears between paragraphs is the result of margins set on these paragraphs; thus, the spacing between paragraphs can be controlled by adjusting the margins on those paragraphs. To eliminate extra spacing between two paragraphs altogether, set the margins for the paragraphs to **0**. To achieve uniform spacing between paragraphs throughout an entire <xref:System.Windows.Documents.FlowDocument>, use styling to set a uniform margin value for all paragraphs in the <xref:System.Windows.Documents.FlowDocument>.
|
|
|
|
It is important to note that the margins for two adjacent paragraphs will "collapse" to the larger of the two margins, rather than doubling up. So, if two adjacent paragraphs have margins of 20 pixels and 40 pixels respectively, the resulting space between the paragraphs is 40 pixels, the larger of the two margin values.
|
|
|
|
## Example
|
|
The following example uses styling to set the margin for all <xref:System.Windows.Documents.Paragraph> elements in a <xref:System.Windows.Documents.FlowDocument> to **0**, which effectively eliminates extra spacing between paragraphs in the <xref:System.Windows.Documents.FlowDocument>.
|
|
|
|
[!code-xaml[BlockSnippets#_ParagraphSpacingXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/BlockSnippets/CSharp/Window1.xaml#_paragraphspacingxaml)]
|