PageBreakBefore Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
If this property is set to true, the paragraph is always displayed on top of a page.
Syntax
public bool PageBreakBefore { get; set; }Public Property PageBreakBefore As BooleanExamples
The following example applies paragraph layout to selected report text by using ParagraphFormat.PageBreakBefore.
textControl.Text = "First item\nSecond item\nThird item";
textControl.Select(0, textControl.Text.Length);
ParagraphFormat paragraphFormat = textControl.Selection.ParagraphFormat;
paragraphFormat.PageBreakBefore = true;
if (paragraphFormat.PageBreakBefore)
{
Console.WriteLine("Paragraph Format: Page Break Before is enabled.");
}
textControl.Selection.ParagraphFormat = paragraphFormat;textControl.Text = "First item" & vbCrLf & "Second item" & vbCrLf & "Third item"
textControl.Select(0, textControl.Text.Length)
Dim paragraphFormat As ParagraphFormat = textControl.Selection.ParagraphFormat
paragraphFormat.PageBreakBefore = True
If paragraphFormat.PageBreakBefore Then
Console.WriteLine("Paragraph Format: Page Break Before is enabled.")
End If
textControl.Selection.ParagraphFormat = paragraphFormatRemarks
The property's default value is false.
The property returns its default value when the text selection contains multiple paragraphs with mixed setting. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.