Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ParagraphPropertiesBase.LineSpacingMultiplier Property

Gets or sets the multiplier which is used to calculate the line spacing value.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

float? LineSpacingMultiplier { get; set; }

Property Value

Type Description
Nullable<Single>

A Single value representing the line spacing multiplier or null (Nothing in Visual Basic), for a mixture of paragraphs with different line spacings.

Remarks

The LineSpacingMultiplier property is used when the Paragraph.LineSpacingType property is set to ParagraphLineSpacing.Multiple.

Use the SubDocument.BeginUpdateParagraphs and the SubDocument.EndUpdateParagraphs paired methods to modify paragraph formatting, such as the ParagraphPropertiesBase.LineSpacing, Paragraph.Alignment, Paragraph.SpacingBefore etc.

To accomplish this, call the SubDocument.BeginUpdateParagraphs method for the specified range, modify the properties of the returned ParagraphProperties object and call the SubDocument.EndUpdateParagraphs method to finalize the modification.

The following code snippet changes the first line indent and the line spacing of the paragraph containing the selection. It also adds a new tab stop for the paragraph using the Paragraph.BeginUpdateTabs - Paragraph.EndUpdateTabs pair of methods.

document.BeginUpdate()
document.AppendText("Modified Paragraph" & vbLf & "Normal" & vbLf & "Normal")
document.EndUpdate()

'The target range is the first paragraph
Dim pos As DocumentPosition = document.Range.Start
Dim range As DocumentRange = document.CreateRange(pos, 0)

' Create and customize an object  
' that sets character formatting for the selected range
Dim pp As ParagraphProperties = document.BeginUpdateParagraphs(range)
' Center paragraph
pp.Alignment = ParagraphAlignment.Center
' Set triple spacing
pp.LineSpacingType = ParagraphLineSpacing.Multiple
pp.LineSpacingMultiplier = 3
' Set left indent at 0.5".
' Default unit is 1/300 of an inch (a document unit).
pp.LeftIndent = DevExpress.Office.Utils.Units.InchesToDocumentsF(0.5F)
' Set tab stop at 1.5"
Dim tbiColl As TabInfoCollection = pp.BeginUpdateTabs(True)
Dim tbi As TabInfo = New DevExpress.XtraRichEdit.API.Native.TabInfo()
tbi.Alignment = TabAlignmentType.Center
tbi.Position = DevExpress.Office.Utils.Units.InchesToDocumentsF(1.5F)
tbiColl.Add(tbi)
pp.EndUpdateTabs(tbiColl)

'Finalize modifications
' with this method call
document.EndUpdateParagraphs(pp)

The following code snippets (auto-collected from DevExpress Examples) contain references to the LineSpacingMultiplier property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also