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