Remove Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document. If text is specified, this text replaces the word's text.
Syntax
Remove(MisspelledWord)
Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document.
public bool Remove(MisspelledWord misspelledWord);Public Function Remove(misspelledWord As MisspelledWord) As Boolean| Parameter | Description |
|---|---|
| misspelledWord | Specifies the misspelled word to remove. |
Remove(MisspelledWord, string)
Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.
public bool Remove(MisspelledWord misspelledWord, string correctedText);Public Function Remove(misspelledWord As MisspelledWord, correctedText As String) As Boolean| Parameter | Description |
|---|---|
| misspelledWord | Specifies the misspelled word to remove. |
| correctedText | Specifies the corrected text. The current text of the word is replaced with this text. |
Return Value
The return value is true, if the misspelled word could be removed. Otherwise, it is false.
Examples
The following example works with misspelled words in the current document by using MisspelledWordCollection.Remove.
MisspelledWordCollection misspelledWordCollection = textControl.MisspelledWords;
if (misspelledWordCollection.Count > 0)
{
MisspelledWord misspelledWord = misspelledWordCollection[1];
if (misspelledWordCollection.Remove(misspelledWord))
{
Console.WriteLine("The item was removed.");
}
}Dim misspelledWordCollection As MisspelledWordCollection = textControl.MisspelledWords
If misspelledWordCollection.Count > 0 Then
Dim misspelledWord As MisspelledWord = misspelledWordCollection.Item(1)
If misspelledWordCollection.Remove(misspelledWord) Then
Console.WriteLine("The item was removed.")
End If
End If