GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets a particular item from the collection.
Syntax
GetItem()
Gets the comment at the current text input position. If there is more than one comment at the current text input position the innermost comment is returned.
public CommentedText GetItem();Public Function GetItem() As CommentedTextGetItem(bool)
Gets the next or the previous comment in the textflow. The search begins at the current text input position.
public CommentedText GetItem(bool next);Public Function GetItem([next] As Boolean) As CommentedText| Parameter | Description |
|---|---|
| next | If this parameter is true, the next comment in the textflow is returned. If this parameter is false, the previous comment in the textflow is returned. The next or the previous comment is returned independent whether there is a comment at the current text input position. |
Return Value
The return value is null, if a comment could not be found. Otherwise, it is an object of the type CommentedText.
Examples
The following example works with comments in the current document by using CommentCollection.get_Item.
CommentCollection commentCollection = textControl.Comments;
textControl.Text = "Payment is due within 30 days.";
textControl.Select(0, textControl.Text.Length);
commentCollection.Add(new CommentedText("Verify the payment term."));
CommentedText result = commentCollection.GetItem();
result?.ScrollTo();Dim commentCollection As CommentCollection = textControl.Comments
textControl.Text = "Payment is due within 30 days."
textControl.Select(0, textControl.Text.Length)
commentCollection.Add(New CommentedText("Verify the payment term."))
Dim result As CommentedText = commentCollection.GetItem()
If result IsNot Nothing Then result.ScrollTo()