Back to Devexpress

TabInfo.Leader Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-tabinfo-985f287c.md

latest6.9 KB
Original Source

TabInfo.Leader Property

Gets or sets the tab leader style, i.e. the symbol used as a tab leader.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public TabLeaderType Leader { get; set; }
vb
Public Property Leader As TabLeaderType

Property Value

TypeDescription
TabLeaderType

A TabLeaderType enumeration member specifying tab leader style.

|

Available values:

NameDescription
None

No leader characters are used.

| | Dots |

The dot is used as a tab leader character.

| | EqualSign |

The equal sign is used as a tab leader character.

| | Hyphens |

The hyphen is used as a tab leader character.

| | MiddleDots |

The middle dot (interpunct) is used as a tab leader character.

| | Underline |

The underscore is used as a tab leader character.

|

Remarks

The Leader property specifies the character which shall be used to fill in the space created by a tab which ends at this tab stop. This character shall be repeated as required to completely fill the tab spacing generated by the tab character.

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 Leader property.

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-richedit-document-api/CS/RichEditAPISample/CodeExamples/PageLayout.cs#L58

csharp
tab1.Alignment = TabAlignmentType.Left;
tab1.Leader = TabLeaderType.MiddleDots;
tabs.Add(tab1);

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

csharp
tab1.Alignment = TabAlignmentType.Left;
tab1.Leader = TabLeaderType.MiddleDots;
tabs.Add(tab1);

word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L102

csharp
tab1.Alignment = TabAlignmentType.Left;
tab1.Leader = TabLeaderType.MiddleDots;

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L53

vb
tab1.Alignment = DevExpress.XtraRichEdit.API.Native.TabAlignmentType.Left
tab1.Leader = DevExpress.XtraRichEdit.API.Native.TabLeaderType.MiddleDots
tabs.Add(tab1)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L46

vb
tab1.Alignment = TabAlignmentType.Left
tab1.Leader = TabLeaderType.MiddleDots
tabs.Add(tab1)

word-document-api-examples/VB/CodeExamples/PageLayoutActions.vb#L86

vb
tab1.Alignment = DevExpress.XtraRichEdit.API.Native.TabAlignmentType.Left
tab1.Leader = DevExpress.XtraRichEdit.API.Native.TabLeaderType.MiddleDots
' Add the tab stop to the collection of tab stops.

See Also

TabInfo Class

TabInfo Members

DevExpress.XtraRichEdit.API.Native Namespace