Using Tabs in TX Text Control
A tab stop can be used to achieve several goals: creating a textual table, indenting a paragraph or adding space between two words. But there are more applications for special types of tabs. TX Text Control offers 5 different types: Left tab Right tab Centered tab Decimal tab Right tab at the right most position The first three tab types are commonly known used. But the other two types are very interesting and can be used in a wide number of applications. A decimal tab can be used to display…

A tab stop can be used to achieve several goals: creating a textual table, indenting a paragraph or adding space between two words. But there are more applications for special types of tabs. TX Text Control offers 5 different types:
- Left tab
- Right tab
- Centered tab
- Decimal tab
- Right tab at the right most position
The first three tab types are commonly known used. But the other two types are very interesting and can be used in a wide number of applications.
A decimal tab can be used to display decimals, such as currencies in an invoice or quotation.
For example: USD 2,000.00
In this case, the dot between the dollars and cents is positioned at the tab stop.
The right tab at the right most position is ideally suited to positioning a date in a letter at the upper right corner. The content will be automatically right aligned.
The different types can be selected by clicking on the tab type button at the left corner in the ruler bar. Additionally, a button in the button bar can be used, if a non-page oriented page view is used. In this case, the ruler bar does not contain this special button.
A paragraph can contain 14 tab stops. In the ActiveX version of TX Text Control, a tab stop can be inserted programmatically in this way:
TXTextControl1.TabCurrent = 1
TXTextControl1.TabType = 4
TXTextControl1.TabPos = 1440
This inserts a decimal tab 1 inch from the left page margin.
In TX Text Control .NET for Windows Forms, this tab will be inserted using the ParagraphFormat class.
Dim myTabTypes(13) As TXTextControl.TabType
myTabTypes = TextControl1.ParagraphFormat.TabTypes
myTabTypes(1) = TXTextControl.TabType.DecimalTab
TextControl1.ParagraphFormat.TabTypes = myTabTypes
The following code snippets shows you how to delete the default tabs.
TX Text Control ActiveX:
for n=14 to 1 step -1
TXTextControl1.TabCurrent = n
TXTextControl1.TabPos = 0
next n
TX Text Control .NET for Windows Forms:
TextControl1.ParagraphFormat.TabPositions = New Integer(13) {0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Related Posts
Create a Table of Contents in Windows Forms using C#
This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.
Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub
This article gives a quick overview of the new repositories, their structure and our plans for the future.
ASP.NETJavaScriptDocument Editor
Detect Toggle Button Changes Using a MutationObserver
This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…
Two Ways to Restart Numbered Lists in TX Text Control
In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…
Zoom Tricks: Disabling CTRL + MOUSE WHEEL and More
This article shows how to disable CTRL + MOUSE WHEEL, implement zooming with keyboard and reset the zoom factor to its default value.