TX Text Control .NET Server

GetItem Method

Method|Introduced in 18.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

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();

GetItem(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);
ParameterDescription
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);
ParameterDescription
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}");