BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
richTextBox.Document.ParagraphFormat.LineSpacing = 0.9; |
//Hook the control loaded event
sfRichTextBox.Loaded += SfRichTextBox_Loaded;
//Hook the document changed event
sfRichTextBox.DocumentChanged += SfRichTextBox_DocumentChanged;
//Occurs when the element is laid out, rendered, and ready for interaction.
private void SfRichTextBox_Loaded(object sender, RoutedEventArgs e)
{
sfRichTextBox.Document.ParagraphFormat.LineSpacing = 0.9;
}
//Occurs when the document is changed in this control
private void SfRichTextBox_DocumentChanged(object obj,DocumentChangedEventArgs args)
{
//Sets the line height as exactly 0.9 pixels within the document default paragraph format.
sfRichTextBox.Document.ParagraphFormat.LineSpacing = 0.9;
} |
Linespacing type |
behaviour |
LineSpacingType.AtLeast
(Minimum Line Height)
|
Specifies that the height of the line shall be at least the
value specified, but might be expanded to fit its
content as needed. |
LineSpacingType.Exactly
(Exact Line Height)
|
Specifies that the height of the line shall be exactly the
value specified, regardless of the size of the contents
of the contents.
If the contents are too large for the specified height,
then they shall be clipped as necessary. |
LineSpacingType.Multiple
|
This will multiple the line height with line spacing value.
For example, consider
Type = Multiple
Line height = 10
Line spacing = 2
Than the actual space added between two line is 10 * 2 = 20.
So, if you want to set small value. set line space like 1 or 0.9
|