Remove Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Removes a CommentedText from the collection. The method removes the saved position values and the comment string. The text, which is commented, is not removed from the document.
Syntax
public bool Remove(CommentedText commentedText);Public Function Remove(commentedText As CommentedText) As BooleanParameters
| Parameter | Description |
|---|---|
| commentedText | Specifies the CommentedText to remove. |
Return Value
The return value is true, if the comment could be removed. Otherwise, it is false.
Examples
The following example works with comments in the current document by using CommentCollection.Remove.
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."));
if (commentCollection.Count > 0)
{
CommentedText commentedText = commentCollection[1];
if (commentCollection.Remove(commentedText))
{
Console.WriteLine("The item was removed.");
}
}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."))
If commentCollection.Count > 0 Then
Dim commentedText As CommentedText = commentCollection.Item(1)
If commentCollection.Remove(commentedText) Then
Console.WriteLine("The item was removed.")
End If
End If