TX Text Control .NET for Windows Forms

AddParagraph Property

Property|Introduced in 26.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Specifies whether or not a new paragraph is created before text is loaded. This property has only an effect, when a LoadSettings object is used with the Selection.Load method. By default a new paragraph is not created. When text is loaded into an existing paragraph the formatting attributes of the existing and the last loaded paragraph are merged. When this property is true, attributes are not merged and the newly created paragraph gets the attributes of the last loaded paragraph.

Syntax

public bool AddParagraph { get; set; }

Examples

The following example configures how a WordprocessingML template is loaded by using LoadSettings.AddParagraph.

LoadSettings loadSettings = new();

loadSettings.AddParagraph = true;
if (loadSettings.AddParagraph)
{
    Console.WriteLine("Load Settings: Add Paragraph is enabled.");
}

textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);