Activate Method
- Namespace
TXTextControl.Web
- Package
TXTextControl.asWeb TXTextControl.from nuget.org, the private NuGet feed or Text Control Offline PackagesWeb. DocumentEditor. dll
Description
Sets the input focus to the specified text part. If the activated text part is not in the visible part of the document, the document is scrolled.
Syntax
public bool Activate(IFormattedText textPart);Public Function Activate(textPart As IFormattedText) As BooleanParameters
| Parameter | Description |
|---|---|
| textPart | Specifies the text part to activate. Must be an object of the type Web.MainText, Web.TextFrame or Web.HeaderFooter. |
Return Value
The return value is true, if the specified text part could be activated. Otherwise it is false.
Examples
The following example activates the first available web text part so subsequent editor commands target that part.
foreach (TXTextControl.Web.IFormattedText textPart in textPartCollection)
{
if (textPartCollection.Activate(textPart))
{
Console.WriteLine("The text part is active.");
break;
}
}For Each textPart As TXTextControl.Web.IFormattedText In textPartCollection
If textPartCollection.Activate(textPart) Then
Console.WriteLine("The text part is active.")
Exit For
End If
Next