# ParagraphFormat Class

> An instance of the ParagraphFormat class represents the formatting attributes of a paragraph.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > ParagraphFormat Class
- **2642 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/llms-full.txt

---

### Description

An instance of the ParagraphFormat class represents the formatting attributes of a paragraph.

### Syntax

```csharp
public class ParagraphFormat
```

```vbnet
Public Class ParagraphFormat
```

### Examples

The following example shows how to add a specific paragraph format to the current paragraph. The text will be centered and a boxed frame is displayed.

```csharp
TXTextControl.ParagraphFormat format = new TXTextControl.ParagraphFormat();
format.Alignment = TXTextControl.HorizontalAlignment.Center;
format.Frame = TXTextControl.Frame.Box;
format.FrameStyle = TXTextControl.FrameStyle.Double;

textControl1.Selection.ParagraphFormat = format;
```

```vbnet
Dim format As TXTextControl.ParagraphFormat = New TXTextControl.ParagraphFormat()
format.Alignment = TXTextControl.HorizontalAlignment.Center
format.Frame = TXTextControl.Frame.Box
format.FrameStyle = TXTextControl.FrameStyle.Double

TextControl1.Selection.ParagraphFormat = format
```

The following example applies paragraph layout to selected report text.

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

```vbnet
textControl.Text = "First item" & vbCrLf & "Second item" & vbCrLf & "Third item"
textControl.Select(0, textControl.Text.Length)
Dim paragraphFormat As ParagraphFormat = textControl.Selection.ParagraphFormat
textControl.Selection.ParagraphFormat = paragraphFormat
```

---

## In This Section

- [ParagraphFormat.AbsoluteLineSpacing Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/absolutelinespacing-property/llms-full.txt): Gets or sets the line spacing of a paragraph in twips.
- [ParagraphFormat.Alignment Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/alignment-property/llms-full.txt): Gets or sets the horizontal text alignment.
- [ParagraphFormat.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/attribute-enumeration/llms-full.txt): Determines a certain paragraph format attribute. This enumeration is used with the Selection.IsCommonValueSelected method. It contains the following values:
- [ParagraphFormat.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/backcolor-property/llms-full.txt): Gets or sets the background color of a paragraph. If the background color is transparent, the paragraph's background is the same as the control's background color.
- [ParagraphFormat.BottomDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/bottomdistance-property/llms-full.txt): Gets or sets the bottom distance, in twips, between this and the next paragraph.
- [ParagraphFormat Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/constructor/llms-full.txt): Creates a new instance of the ParagraphFormat class.
- [ParagraphFormat.Direction Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/direction-property/llms-full.txt): Gets or sets the writing direction. A paragraph's writing direction can be either left to right or right to left.
- [ParagraphFormat.Frame Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/frame-property/llms-full.txt): Gets or sets a frame around the paragraph.
- [ParagraphFormat.FrameDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/framedistance-property/llms-full.txt): Gets or sets the distance, in twips, between the text and the paragraph's frame.
- [ParagraphFormat.FrameLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/framelinecolor-property/llms-full.txt): Gets or sets the color used for the frame lines of a paragraph.
- [ParagraphFormat.FrameLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/framelinewidth-property/llms-full.txt): Gets or sets the line width, in twips, of the paragraph's frame.
- [ParagraphFormat.FrameStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/framestyle-property/llms-full.txt): Gets or sets the style of the paragraph's frame.
- [ParagraphFormat.HangingIndent Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/hangingindent-property/llms-full.txt): Gets or sets the distance, in twips, for the hanging indent. A negative value indicates an additional indent of the paragraph's first line.
- [ParagraphFormat.Justification Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/justification-property/llms-full.txt): Gets or sets the kind of justification in documents containing Arabic or Hebrew characters. If a paragraph is justified, the additional space to justify the line is added to the spaces between the words. If the line contains Arabic or Hebrew characters the line can also be justified though the insertion of Kashida lines.
- [ParagraphFormat.KeepLinesTogether Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/keeplinestogether-property/llms-full.txt): Gets or sets a value indicating whether a page break is allowed within the paragraph. If the property's value is true, a page break is not allowed. Otherwise, it is allowed.
- [ParagraphFormat.KeepWithNext Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/keepwithnext-property/llms-full.txt): If this property is set to true, the paragraph is displayed on the same page as its following paragraph.
- [ParagraphFormat.LeftIndent Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/leftindent-property/llms-full.txt): Gets or sets the distance, in twips, between the left edge of the Text Control and the left edge of the text.
- [ParagraphFormat.LineSpacing Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/linespacing-property/llms-full.txt): Specifies the line spacing of a paragraph as a percentage of the font size.
- [ParagraphFormat.MaxTabs Field](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/maxtabs-field/llms-full.txt): Represents the maximum number of tabs in a line. The value of this constant is 14.
- [ParagraphFormat.PageBreakBefore Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/pagebreakbefore-property/llms-full.txt): If this property is set to true, the paragraph is always displayed on top of a page.
- [ParagraphFormat.RightIndent Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/rightindent-property/llms-full.txt): Gets or sets the distance, in twips, between the right edge of a Text Control document and the right edge of the text.
- [ParagraphFormat.StructureLevel Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/structurelevel-property/llms-full.txt): Gets or sets the structure level of a paragraph in the document. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.
- [ParagraphFormat.TabLeaders Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/tableaders-property/llms-full.txt): Gets or sets an array containing the tab leaders in a paragraph. A tab leader defines how a tab gap is filled.
- [ParagraphFormat.TabPositions Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/tabpositions-property/llms-full.txt): Gets or sets an array containing the absolute tab stop positions, in twips, in a paragraph.
- [ParagraphFormat.TabTypes Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/tabtypes-property/llms-full.txt): Gets or sets an array containing the tab types in a paragraph.
- [ParagraphFormat.TopDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/topdistance-property/llms-full.txt): Gets or sets a top distance, in twips, between this and the previous paragraph.
- [ParagraphFormat.WidowOrphanLines Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/widoworphanlines-property/llms-full.txt): Gets or sets the number of lines for widow/orphan control. Widow/orphan control avoids that a paragraph is started at the bottom of a page and that either, the majority of its lines, or only a few lines are displayed on the next page. This property's value determines how many lines must not be separated from the rest of the paragraph. For example, if this property is set to two, there must be at least three lines of the paragraph at the bottom of the previous page and at least three lines at the top of the next page. Otherwise, the complete paragraph is displayed on the next page. If this property is set to zero, widow/orphan control is disabled.

---

## Nearby

- **Previous:** [ParagraphCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphcollection/item-property/llms-full.txt)
- **Next:** [ParagraphFormat.AbsoluteLineSpacing Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/absolutelinespacing-property/llms-full.txt)
