Version

Managing Tab Stops (xamRichTextEditor)

Topic Overview

Purpose

This topic explains how to use the xamRichTextEditor ™ to manage tab stops.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides an overview of the features supported by the xamRichTextEditor control.

This topic explains the document’s content logical structure you can use to edit the contents in the xamRichTextEditor programmatically.

This topic provides detailed instructions to help you get up and running as quickly as possible with the xamRichTextEditor .

In this topic

This topic contains the following sections:

Introduction

Context menu summary

The xamRichTextEditor control supports tab stops for each paragraph individually and uses them to specify the locations where the Caret stops after the user presses the Tab key. This way the user may achieve content alignment in single and/or multiple paragraphs.

You can define tab stops by invoking the AddTab method of the TabStops collection of each ParagraphNode.Settings. This collection also has methods for removing and obtaining tab stops.

Defining Tab Stops

Overview

Tab stops are defined by three key parameters:

  • the offset from the start of the line where the tab stop should occur

  • the alignment of the content relative to the tab stops’ offset

  • the characters used to fill the leading space before the tab stop offset

You can customize the tab stops with several different content alignments and various characters fills for the content’s leading space, which is listed in the following table.

Property settings

The following table maps the desired configuration to its respective argument of the AddTab method.

In order to: Use this argument And:

Configure the tab stop offset

position

Set it to a value of type Extent

Configure the content’s alignment

alignment

Set it to a value of type TabStopAlignment

Configure the content’s leading characters

leader

Set it to a value of type TabStopLeader

Code example

The following code snippet shows how to set a tab stop with 200 pixels offset, start tab stop alignment and a dot used for the leading fill character:

In C#:

ParagraphSettings ps = paragraphNode.Settings;
ps.TabStops.AddTab(
    new Extent(200, ExtentUnitType.LogicalPixels),
    TabStopAlignment.Start,
    TabStopLeader.Dot);

In Visual Basic:

Dim ps As ParagraphSettings = paragraphNode.Settings
ps.TabStops.AddTab( _
    New Extent(200, ExtentUnitType.LogicalPixels), _
    TabStopAlignment.Start, _
    TabStopLeader.Dot)

The following screenshot shows the xamRichTextEditor with a 200 pixels tab stop defined in the first paragraph. The leading characters of the tab stop is DOT and it is filling the 200 pixels before the text:

xamRichTextEditor TabStops01.png

Related Content

Topics

The following topic provides additional information related to this topic.

Topic Purpose

This topic explains how to configure several useful content editing features of the xamRichTextEditor control.