ITextParagraphFormat ITextParagraphFormat ITextParagraphFormat Interface

Definition

Defines the default paragraph formatting attributes of a document, or the current paragraph formatting attributes of a text range.

public interface ITextParagraphFormatpublic interface ITextParagraphFormatPublic Interface ITextParagraphFormat
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Alignment Alignment Alignment

Gets or sets the paragraph alignment.

public ParagraphAlignment Alignment { get; set; }public ParagraphAlignment Alignment { get; set; }Public ReadWrite Property Alignment As ParagraphAlignment
Value
ParagraphAlignment ParagraphAlignment ParagraphAlignment

The paragraph alignment value.

Attributes

FirstLineIndent FirstLineIndent FirstLineIndent

Gets the amount used to indent the first line of a paragraph relative to the left indent.

public float FirstLineIndent { get; }public float FirstLineIndent { get; }Public ReadOnly Property FirstLineIndent As float
Value
float float float

The first line indentation amount, in floating-point points.

Attributes

Remarks

The left indent applies to all lines of the paragraph except the first line.

KeepTogether KeepTogether KeepTogether

Gets or sets whether page breaks are allowed in paragraphs.

public FormatEffect KeepTogether { get; set; }public FormatEffect KeepTogether { get; set; }Public ReadWrite Property KeepTogether As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

A value that indicates whether page breaks are allowed.

Attributes

KeepWithNext KeepWithNext KeepWithNext

Gets or sets whether page breaks are allowed between paragraphs in a range.

public FormatEffect KeepWithNext { get; set; }public FormatEffect KeepWithNext { get; set; }Public ReadWrite Property KeepWithNext As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

The value that indicates whether page breaks are allowed.

Attributes

LeftIndent LeftIndent LeftIndent

Gets the amount used to indent all lines except the first line of a paragraph.

public float LeftIndent { get; }public float LeftIndent { get; }Public ReadOnly Property LeftIndent As float
Value
float float float

The amount of left indentation, in floating-point points. Indentation is relative to the left margin.

Attributes

LineSpacing LineSpacing LineSpacing

Gets the paragraph line-spacing value.

public float LineSpacing { get; }public float LineSpacing { get; }Public ReadOnly Property LineSpacing As float
Value
float float float

The line spacing value. The meaning depends on the value of the LineSpacingRule property. The line spacing value is in floating-point points except when the line-spacing rule is Multiple or Percent.

Attributes

LineSpacingRule LineSpacingRule LineSpacingRule

Gets the paragraph line-spacing rule.

public LineSpacingRule LineSpacingRule { get; }public LineSpacingRule LineSpacingRule { get; }Public ReadOnly Property LineSpacingRule As LineSpacingRule
Value
LineSpacingRule LineSpacingRule LineSpacingRule

The paragraph line-spacing rule.

Attributes

ListAlignment ListAlignment ListAlignment

Gets or sets the alignment to use for bulleted and numbered lists.

public MarkerAlignment ListAlignment { get; set; }public MarkerAlignment ListAlignment { get; set; }Public ReadWrite Property ListAlignment As MarkerAlignment
Value
MarkerAlignment MarkerAlignment MarkerAlignment

The alignment for bulleted and numbered lists.

Attributes

ListLevelIndex ListLevelIndex ListLevelIndex

Gets or sets the list level index used with paragraphs.

public int ListLevelIndex { get; set; }public int ListLevelIndex { get; set; }Public ReadWrite Property ListLevelIndex As int
Value
int int int

The list level index. It can be a value of 0 or higher, as described in the following table.

ValueMeaning
0No list.
1First-level (outermost) list.
2Second-level (nested) list. This is nested under a level 1 list item.
3Third-level (nested) list. This is nested under a level 2 list item.
And so onNesting continues similarly.

Up to three levels are common in HTML documents.

Attributes

Remarks

Setting the list level index doesn't automatically change a list's indentation and other paragraph properties.

ListStart ListStart ListStart

Gets or sets the starting value or code of a list numbering sequence.

public int ListStart { get; set; }public int ListStart { get; set; }Public ReadWrite Property ListStart As int
Value
int int int

The starting value or code of a list numbering sequence.

Attributes

ListStyle ListStyle ListStyle

Gets or sets the style used to mark the item paragraphs in a list.

public MarkerStyle ListStyle { get; set; }public MarkerStyle ListStyle { get; set; }Public ReadWrite Property ListStyle As MarkerStyle
Value
MarkerStyle MarkerStyle MarkerStyle

The style used to mark the item paragraphs.

Attributes

ListTab ListTab ListTab

Gets or sets the list tab setting, which is the distance between the first indent and the start of the text on the first line.

public float ListTab { get; set; }public float ListTab { get; set; }Public ReadWrite Property ListTab As float
Value
float float float

The list tab setting.

Attributes

Remarks

Numbered or bulleted text is left-justified, centered, or right-justified at the first-line indent value. Use ITextParagraphFormat.ListAlignment to determine the text position.

ListType ListType ListType

Gets or sets the kind of characters used to mark the item paragraphs in a list.

public MarkerType ListType { get; set; }public MarkerType ListType { get; set; }Public ReadWrite Property ListType As MarkerType
Value
MarkerType MarkerType MarkerType

The kind of characters used to mark the item paragraphs.

Attributes

NoLineNumber NoLineNumber NoLineNumber

Gets or sets whether paragraph numbering is suppressed.

public FormatEffect NoLineNumber { get; set; }public FormatEffect NoLineNumber { get; set; }Public ReadWrite Property NoLineNumber As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

A value that indicates whether line numbering is suppressed.

Attributes

Remarks

When the paragraphs are numbered, the number appears on the first line of the paragraph.

PageBreakBefore PageBreakBefore PageBreakBefore

Gets or sets whether there is a page break before a paragraph.

public FormatEffect PageBreakBefore { get; set; }public FormatEffect PageBreakBefore { get; set; }Public ReadWrite Property PageBreakBefore As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

A value that indicates whether there is page break.

Attributes

RightIndent RightIndent RightIndent

Gets or sets the right margin of a paragraph.

public float RightIndent { get; set; }public float RightIndent { get; set; }Public ReadWrite Property RightIndent As float
Value
float float float

The size of the right margin, in floating-point points.

Attributes

RightToLeft RightToLeft RightToLeft

Gets or sets whether the paragraph uses right-to-left formatting.

public FormatEffect RightToLeft { get; set; }public FormatEffect RightToLeft { get; set; }Public ReadWrite Property RightToLeft As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

A value that indicates whether the paragraph uses right-to-left formatting.

Attributes

SpaceAfter SpaceAfter SpaceAfter

Gets or sets the amount of vertical space that follows a paragraph.

public float SpaceAfter { get; set; }public float SpaceAfter { get; set; }Public ReadWrite Property SpaceAfter As float
Value
float float float

The amount of vertical space, in floating-point points.

Attributes

SpaceBefore SpaceBefore SpaceBefore

Gets or sets the amount of vertical space above a paragraph.

public float SpaceBefore { get; set; }public float SpaceBefore { get; set; }Public ReadWrite Property SpaceBefore As float
Value
float float float

The amount of vertical space, in floating-point points.

Attributes

Style Style Style

Gets or sets the paragraph style.

public ParagraphStyle Style { get; set; }public ParagraphStyle Style { get; set; }Public ReadWrite Property Style As ParagraphStyle
Value
ParagraphStyle ParagraphStyle ParagraphStyle

The paragraph style.

Attributes

TabCount TabCount TabCount

Retrieves the tab count.

public int TabCount { get; }public int TabCount { get; }Public ReadOnly Property TabCount As int
Value
int int int

The tab count.

Attributes

Remarks

The tab count of a new instance can be nonzero; for example, Microsoft Word stories begin with no explicit tabs defined, while rich edit instances start with a single explicit tab. To ensure there are no explicit tabs (that is, to set the tab count to zero), call the ITextParagraphFormat.ClearAllTabs method.

WidowControl WidowControl WidowControl

Gets or sets whether widow and orphan suppression is on or off.

public FormatEffect WidowControl { get; set; }public FormatEffect WidowControl { get; set; }Public ReadWrite Property WidowControl As FormatEffect
Value
FormatEffect FormatEffect FormatEffect

The state of window and orphan suppression.

Attributes

Remarks

A widow is created when the last line of a paragraph is printed by itself at the top of a page. An orphan is when the first line of a paragraph is printed by itself at the bottom of a page.

Methods

AddTab(Single, TabAlignment, TabLeader) AddTab(Single, TabAlignment, TabLeader) AddTab(Single, TabAlignment, TabLeader)

Adds a new tab at the specified position.

public void AddTab(Single position, TabAlignment align, TabLeader leader)public void AddTab(Single position, TabAlignment align, TabLeader leader)Public Function AddTab(position As Single, align As TabAlignment, leader As TabLeader) As void
Parameters
position
System.Single System.Single System.Single

The position of the new tab, in floating-point points relative to the left side of the page for left-to-right paragraphs, or the right side of the page for right-to-left paragraphs. A maximum of 63 tabs are allowed. Tabs beyond the page are ignored. Negative tabs are not valid.

align
TabAlignment TabAlignment TabAlignment

The alignment option for the tab position.

leader
TabLeader TabLeader TabLeader

The character used to fill the space taken by a tab character.

Attributes

ClearAllTabs() ClearAllTabs() ClearAllTabs()

Clears all tabs, reverting to equally spaced tabs with the default tab spacing.

public void ClearAllTabs()public void ClearAllTabs()Public Function ClearAllTabs() As void
Attributes

DeleteTab(Single) DeleteTab(Single) DeleteTab(Single)

Deletes the tab at the specified position.

public void DeleteTab(Single position)public void DeleteTab(Single position)Public Function DeleteTab(position As Single) As void
Parameters
position
System.Single System.Single System.Single

The position of the tab to delete, in floating-point points.

Attributes

GetClone() GetClone() GetClone()

Creates a new object that is identical to this paragraph format object.

public ITextParagraphFormat GetClone()public ITextParagraphFormat GetClone()Public Function GetClone() As ITextParagraphFormat
Returns

The duplicate paragraph format object.

Attributes

GetTab(Int32, Single, TabAlignment, TabLeader) GetTab(Int32, Single, TabAlignment, TabLeader) GetTab(Int32, Single, TabAlignment, TabLeader)

Retrieves information about the specified tab.

public void GetTab(Int32 index, Single position, TabAlignment align, TabLeader leader)public void GetTab(Int32 index, Single position, TabAlignment align, TabLeader leader)Public Function GetTab(index As Int32, position As Single, align As TabAlignment, leader As TabLeader) As void
Parameters
index
System.Int32 System.Int32 System.Int32

The zero-based index of the tab to retrieve.

position
System.Single System.Single System.Single

The tab's position, in floating-point points. This parameter is zero if the tab does not exist.

align
TabAlignment TabAlignment TabAlignment

The alignment option for the tab position.

leader
TabLeader TabLeader TabLeader

The character used to fill the space taken by a tab character.

Attributes

IsEqual(ITextParagraphFormat) IsEqual(ITextParagraphFormat) IsEqual(ITextParagraphFormat)

Determines whether this paragraph format object has the same properties as the specified paragraph format object.

public bool IsEqual(ITextParagraphFormat format)public bool IsEqual(ITextParagraphFormat format)Public Function IsEqual(format As ITextParagraphFormat) As bool
Parameters
format
ITextParagraphFormat ITextParagraphFormat ITextParagraphFormat

The paragraph format object to compare against.

Returns
bool bool bool

True if the objects have the same properties, or false if they don't.

Attributes

SetClone(ITextParagraphFormat) SetClone(ITextParagraphFormat) SetClone(ITextParagraphFormat)

Sets the paragraph formatting by copying another paragraph formatting object.

public void SetClone(ITextParagraphFormat format)public void SetClone(ITextParagraphFormat format)Public Function SetClone(format As ITextParagraphFormat) As void
Parameters
format
ITextParagraphFormat ITextParagraphFormat ITextParagraphFormat

The paragraph formatting to apply.

Attributes

Remarks

Any paragraph formatting values that are undefined in value have no effect.

SetIndents(Single, Single, Single) SetIndents(Single, Single, Single) SetIndents(Single, Single, Single)

Sets the first-line indent, the left indent, and the right indent for a paragraph.

public void SetIndents(Single start, Single left, Single right)public void SetIndents(Single start, Single left, Single right)Public Function SetIndents(start As Single, left As Single, right As Single) As void
Parameters
start
System.Single System.Single System.Single

The indent of the first line in a paragraph, relative to the left indent. The value is in floating-point points and can be positive or negative.

left
System.Single System.Single System.Single

The left indent of all lines except the first line in a paragraph, relative to the left margin. The value is in floating-point points and can be positive or negative.

right
System.Single System.Single System.Single

The right indent of all lines in a paragraph, relative to the right margin. The value is in floating-point points and can be positive or negative. This value is optional.

Attributes

Remarks

Line indents cannot position text in the margins. If the first-line indent is set to a negative value, for an outdented paragraph, while the left indent is zero, the first-line indent is reset to zero. To avoid this problem while retaining property sets, explicitly set the first-line indent value equal to zero, and then call SetIndents to set a nonnegative, left-indent value and set the desired first-line indent.

SetLineSpacing(LineSpacingRule, Single) SetLineSpacing(LineSpacingRule, Single) SetLineSpacing(LineSpacingRule, Single)

Sets the paragraph line-spacing rule and the amount of line spacing for a paragraph.

public void SetLineSpacing(LineSpacingRule rule, Single spacing)public void SetLineSpacing(LineSpacingRule rule, Single spacing)Public Function SetLineSpacing(rule As LineSpacingRule, spacing As Single) As void
Parameters
rule
LineSpacingRule LineSpacingRule LineSpacingRule

The new line-spacing rule.

spacing
System.Single System.Single System.Single

The new line spacing amount. If the line-spacing rule interprets the spacing value as a linear dimension, spacing is given in floating-point points.

Attributes

Remarks

Because the line-spacing rule and line spacing work together, they must be set together.