Back to Devexpress

ParagraphPropertiesWithTabs.BeginUpdateTabs(Boolean) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertieswithtabs-dot-beginupdatetabs-x28-system-dot-boolean-x29.md

latest7.2 KB
Original Source

ParagraphPropertiesWithTabs.BeginUpdateTabs(Boolean) Method

Starts modifying paragraph tab stops.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
TabInfoCollection BeginUpdateTabs(
    bool onlyOwnTabs
)
vb
Function BeginUpdateTabs(
    onlyOwnTabs As Boolean
) As TabInfoCollection

Parameters

NameTypeDescription
onlyOwnTabsBoolean

true to set tab stops for the target paragraph only, disregarding style; false to merge tab stops which are set for the paragraph style and for the individual paragraph.

|

Returns

TypeDescription
TabInfoCollection

A collection of paragraph tab stops.

|

Example

The code sample below sets the document measurement Document.Unit to inches and specifies tab stops. Tab stops are set and updated for the target paragraph only.

View Example

csharp
using XtraRichEdit.API.Native;
using DevExpress.Office;

using (var wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument("FirstLook.docx");
    Document document = wordProcessor.Document;

    document.Unit = DocumentUnit.Inch;

    // Access first paragraph tabs
    TabInfoCollection tabs = document.Paragraphs[0].BeginUpdateTabs(true);

    // Set the first tab stop at 2.5 inch
    TabInfo tab1 = new TabInfo();
    tab1.Position = 2.5f;
    tab1.Alignment = TabAlignmentType.Left;
    tab1.Leader = TabLeaderType.MiddleDots;
    tabs.Add(tab1);

    // Set the second tab stop at 5.5 inch
    TabInfo tab2 = new TabInfo();
    tab2.Position = 5.5f;
    tab2.Alignment = TabAlignmentType.Decimal;
    tab2.Leader = TabLeaderType.EqualSign;
    tabs.Add(tab2);

    document.Paragraphs[0].EndUpdateTabs(tabs);
}
vb
Imports XtraRichEdit.API.Native
Imports DevExpress.Office

Using wordProcessor = New RichEditDocumentServer()
    wordProcessor.LoadDocument("FirstLook.docx")
    Dim document As Document = wordProcessor.Document

    document.Unit = DocumentUnit.Inch

    ' Access first paragraph tabs
    Dim tabs As TabInfoCollection = document.Paragraphs(0).BeginUpdateTabs(True)

    ' Set the first tab stop at 2.5 inch
    Dim tab1 As New TabInfo()
    tab1.Position = 2.5F
    tab1.Alignment = TabAlignmentType.Left
    tab1.Leader = TabLeaderType.MiddleDots
    tabs.Add(tab1)

    ' Set the second tab stop at 5.5 inch
    Dim tab2 As New TabInfo()
    tab2.Position = 5.5F
    tab2.Alignment = TabAlignmentType.Decimal
    tab2.Leader = TabLeaderType.EqualSign
    tabs.Add(tab2)

    document.Paragraphs(0).EndUpdateTabs(tabs)
End Using

[BeginUpdateTabs] xref:DevExpress.XtraRichEdit.API.Native.Paragraph.BeginUpdateTabs(System.Boolean)

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdateTabs(Boolean) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L77

csharp
//Set tab stop at 1.5"
TabInfoCollection tbiColl = titleParagraphFormatting.BeginUpdateTabs(true);
TabInfo tbi = new TabInfo();

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Formatting.cs#L71

csharp
// Set tab stop at 1.5"
TabInfoCollection tbiColl = pp.BeginUpdateTabs(true);
TabInfo tbi = new DevExpress.XtraRichEdit.API.Native.TabInfo();

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L58

csharp
// Set tab stop at 1.5"
TabInfoCollection tbiColl = pp.BeginUpdateTabs(true);
TabInfo tbi = new TabInfo();

winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L73

vb
'Set tab stop at 1.5"
Dim tbiColl As TabInfoCollection = titleParagraphFormatting.BeginUpdateTabs(True)
Dim tbi As New TabInfo()

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Formatting.vb#L64

vb
' Set tab stop at 1.5"
Dim tbiColl As DevExpress.XtraRichEdit.API.Native.TabInfoCollection = pp.BeginUpdateTabs(True)
Dim tbi As DevExpress.XtraRichEdit.API.Native.TabInfo = New DevExpress.XtraRichEdit.API.Native.TabInfo()

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L53

vb
' Set tab stop at 1.5"
Dim tbiColl As TabInfoCollection = pp.BeginUpdateTabs(True)
Dim tbi As New TabInfo()

word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L111

vb
' Start to modify tab stops in the paragraph.
Dim tbiColl As DevExpress.XtraRichEdit.API.Native.TabInfoCollection = pp.BeginUpdateTabs(True)
' Create a new tab stop for the paragraph.

See Also

ParagraphPropertiesWithTabs Interface

ParagraphPropertiesWithTabs Members

DevExpress.XtraRichEdit.API.Native Namespace