SetTab

Description

Sets the alignment type and position of the tab stop in a RichTextEdit control.

Applies to

RichTextEdit controls

Syntax

rtename.SetTab (integer tabcurrent, integer tabtype, integer tabpos)

Argument

Description

rtename

The name of the RichTextEdit control in which you want to set the tab stop

tabcurrent

An integer specifying the index of the tab stop that you want to set. Possible values are from 1 to 14.

tabtype

An integer specifying the type of the tab stop. Possible values are:

1: Left-aligned tab stop -- The text will be aligned to the left when it reaches this tab stop.

2: Right-aligned tab stop -- The text will be aligned to the right at this tab stop.

3: Center-aligned tab stop -- The text will be centred at this tab stop.

4: Decimal-aligned tab stop -- Useful for aligning numbers with decimal points (e.g. for financial documents).

5: Rightmost tab stop -- The text will be placed at the furthest right edge, often used for right-aligned columns or data. tabpos will be ignored for this type.

tabpos

An integer specifying the position of the tab stop. This is the distance from the left margin where the tab stop will be placed. It is measured in twip (Twentieth of a Point).


Return value

Integer.

Returns 1 if it succeeds and -1 if the value of tabcurrent or tabtype is invalid.

Examples

This example sets the first tab stop to be center-aligned at a position of 1440 twips from the left margin:

integer li_rtn
li_rtn = rte_1.SetTab (1, 3, 1440)