ParagraphSettings ps = paragraphNode.Settings;
ps.TabStops.AddTab(
new Extent(200, ExtentUnitType.LogicalPixels),
TabStopAlignment.Start,
TabStopLeader.Dot);
This topic explains how to use the xamRichTextEditor ™ to manage tab stops.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
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.
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.
The following table maps the desired configuration to its respective argument of the AddTab
method.
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:
The following topic provides additional information related to this topic.