TX Text Control .NET for Windows Forms

FrameDistance Property

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

Description

Gets or sets the distance, in twips, between the text and the paragraph's frame.

Syntax

public int FrameDistance { get; set; }

Examples

The following example applies paragraph layout to selected report text by using ParagraphFormat.FrameDistance.

textControl.Text = "First item\nSecond item\nThird item";
textControl.Select(0, textControl.Text.Length);
ParagraphFormat paragraphFormat = textControl.Selection.ParagraphFormat;

paragraphFormat.FrameDistance = 720;
Console.WriteLine($"Frame Distance used by Paragraph Format: {paragraphFormat.FrameDistance}");

textControl.Selection.ParagraphFormat = paragraphFormat;

Remarks

The property's default value is 0.

The property returns its default value when the text selection contains multiple paragraphs with mixed distances. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.