ChangeDirection Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Changes the writing direction of all selected paragraphs. When the direction of a paragraph is changed, this paragraph's alignment is toggled from left to right or from right to left. The alignment of centered and justified paragraphs is not changed. Left and right tabulators are also toggled.
Syntax
public bool ChangeDirection(Direction direction);Public Function ChangeDirection(direction As Direction) As BooleanParameters
| Parameter | Description | ||||||
|---|---|---|---|---|---|---|---|
| direction | Specifies the writing direction. It can be one of the Direction values:
|
Return Value
The return value is true, if at least one paragraph has been changed. Otherwise is is false.
Examples
The following example formats the heading of a short document by using Selection.ChangeDirection.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;
if (selection.ChangeDirection(Direction.LeftToRight))
{
Console.WriteLine("Change Direction completed successfully.");
}textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection
If selection.ChangeDirection(Direction.LeftToRight) Then
Console.WriteLine("Change Direction completed successfully.")
End If