GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets a particular line from the collection.
Syntax
GetItem(Point)
Gets the line at a certain geometrical position.
public Line GetItem(Point location);Public Function GetItem(location As Point) As Line| Parameter | Description |
|---|---|
| location | Specifies the line's location. The point must be specified in pixels with an origin at the top left corner of the control. |
GetItem(int)
Gets the line at a certain text position.
public Line GetItem(int textPosition);Public Function GetItem(textPosition As Integer) As Line| Parameter | Description |
|---|---|
| textPosition | Specifies a zero-based text position. |
Return Value
The return value is null, if a line could not be found. Otherwise, it is an object of the type Line.
Examples
The following example works with lines in the current document by using LineCollection.get_Item.
LineCollection lineCollection = textControl.Lines;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
var result = lineCollection.GetItem(new System.Drawing.Point(20, 20));
Console.WriteLine($"Get Item result: {result}");Dim lineCollection As LineCollection = textControl.Lines
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim result = lineCollection.GetItem(New System.Drawing.Point(20, 20))
Console.WriteLine($"Get Item result: {result}")