TX Text Control .NET for WPF

GetActivatedItem Method

Method|Introduced in 23.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Returns the currently activated text frame. An activated text frame has the input focus and can be edited. The method returns null, if no text frame is activated.

Syntax

public TextFrame GetActivatedItem();

Return Value

The return value is null, if an activated text frame 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.GetActivatedItem.

TextFrameCollection textFrameCollection = textControl.TextFrames;
textFrameCollection.Add(new TextFrame(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 100 }, TextFrameInsertionMode.DisplaceText);

var result = textFrameCollection.GetActivatedItem();
Console.WriteLine($"Get Activated Item result: {result}");