TX Text Control .NET for Windows Forms Documentation

Line Class

An instance of the Line class represents a single line in a Text Control document.

Introduced: 10.1.

Syntax

[C#] public class Line
[Visual Basic] Public Class Line

Properties

PropertyDescription
BaselineGets the line's baseline position.
LengthGets the number of characters in the line including the break character.
NumberGets the line's number.
PageGets the number of the page to which the line belongs.
StartGets the number (one-based) of the first character in the line.
TextGets the line's text.
TextBoundsGets the bounding rectangle of the text belonging to the line.

Methods

MethodDescription
SaveOverloaded. Saves the line's text in a byte array or as a string with a specified format.

Example

The following example shows how to read the document line by line.

[C#] textControl1.Text = "Line 1\nLine 2\nLine 3"; foreach (TXTextControl.Line line in textControl1.Lines) { Console.WriteLine("Line #" + line.Number.ToString() + " starts at: " + line.Start.ToString() + ". Text: " + line.Text); }
[Visual Basic] TextControl1.Text = "Line 1" + vbCrLf + "Line 2" + vbCrLf + "Line 3" For Each line As TXTextControl.Line In TextControl1.Lines Console.WriteLine("Line #" + line.Number.ToString() + " starts at: " + _ line.Start.ToString() + ". Text: " + line.Text) Next

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now