GetActivatedItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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();Public Function GetActivatedItem() As TextFrameReturn 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}");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.GetActivatedItem()
Console.WriteLine($"Get Activated Item result: {result}")