GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets a particular text frame from the collection.
Syntax
GetItem()
Gets the text frame selected by the user or null if no text frame is selected.
public TextFrame GetItem();Public Function GetItem() As TextFrameGetItem(int)
Gets the text frame with the specified identifier.
public TextFrame GetItem(int id);Public Function GetItem(id As Integer) As TextFrame| Parameter | Description |
|---|---|
| id | Specifies the text frame's identifier set with the ID property. The method returns null if a text frame with the specified identifier does not exist. |
GetItem(string)
Gets the text frame with the specified name.
public TextFrame GetItem(string name);Public Function GetItem(name As String) As TextFrame| Parameter | Description |
|---|---|
| name | Specifies the text frame's name set with the Name property. The method returns null if a text frame with the specified name does not exist. |
Return Value
The return value is null, if a text frame with the specified parameters could not be found. Otherwise, it is an object of the type TextFrame.
Examples
The following example works with text frames in the current document by using TextFrameCollection.GetItem.
TextFrameCollection textFrameCollection = textControl.TextFrames;
textFrameCollection.Add(new TextFrame(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 100 }, TextFrameInsertionMode.DisplaceText);
var result = textFrameCollection.GetItem(100);
Console.WriteLine($"Get Item result: {result}");Dim textFrameCollection As TextFrameCollection = textControl.TextFrames
textFrameCollection.Add(New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout", .ID = 100 }, TextFrameInsertionMode.DisplaceText)
Dim result = textFrameCollection.GetItem(100)
Console.WriteLine($"Get Item result: {result}")