GetItem 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
Gets a particular item from the collection.
Syntax
GetItem()
Gets the misspelled word at the current text input position. If there is no misspelled word, the next possible word is returned. If there is no misspelled word between the current input position and the end of the text, the first word is returned.
public MisspelledWord GetItem();Public Function GetItem() As MisspelledWordGetItem(MisspelledWordKind)
Gets the misspelled word of the specified kind at the current text input position. If there is no misspelled word, the next possible word of is returned. If there is no misspelled word of the specified kind between the current input position and the end of the text, the first word of the specified kind is returned.
public MisspelledWord GetItem(MisspelledWordKind kind);Public Function GetItem(kind As MisspelledWordKind) As MisspelledWord| Parameter | Description |
|---|---|
| kind | Specifies the word's kind. It must be one or more values of the MisspelledWordKind enumeration. |
GetItem(Point)
Gets the misspelled word at a certain geometrical location. If there is no misspelled word, null is returned.
public MisspelledWord GetItem(Point location);Public Function GetItem(location As Point) As MisspelledWord| Parameter | Description |
|---|---|
| location | Specifies the word's location. The point must be specified in pixels with an origin at the top left corner of the control. If there is no misspelled word at the specified location, null is returned. |
GetItem(int)
Gets the misspelled word at the specified text input position. If there is no misspelled word, the next possible word is returned. If there is no misspelled word between the specified input position and the end of the text, the first word is returned.
public MisspelledWord GetItem(int textPosition);Public Function GetItem(textPosition As Integer) As MisspelledWord| Parameter | Description |
|---|---|
| textPosition | Specifies a zero-based text postion. The text positions in front of a word and behind a word belong to the word. If there is no misspelled word, the next possible word is returned. If there is no misspelled word between the specified text position and the end of the text, the first word is returned. |
GetItem(int, MisspelledWordKind)
Gets the misspelled word of the specified kind at the specified text input position. If there is no misspelled word, the next possible word is returned. If there is no misspelled word of the specified kind between the specified input position and the end of the text, the first word of the specified kind is returned.
public MisspelledWord GetItem(int textPosition, MisspelledWordKind kind);Public Function GetItem(textPosition As Integer, kind As MisspelledWordKind) As MisspelledWord| Parameter | Description |
|---|---|
| textPosition | Specifies a zero-based text postion. The text positions in front of a word and behind a word belong to the word. If there is no misspelled word, the next possible word is returned. If there is no misspelled word between the specified text position and the end of the text, the first word is returned. |
| kind | Specifies the word's kind. It must be one or more values of the MisspelledWordKind enumeration. |
Return Value
The return value is null, if a misspelled word could not be found. Otherwise, it is an object of the type MisspelledWord.
Examples
The following example works with misspelled words in the current document by using MisspelledWordCollection.get_Item.
MisspelledWordCollection misspelledWordCollection = textControl.MisspelledWords;
MisspelledWord result = misspelledWordCollection.GetItem(1, MisspelledWordKind.Normal);
result?.Select();Dim misspelledWordCollection As MisspelledWordCollection = textControl.MisspelledWords
Dim result As MisspelledWord = misspelledWordCollection.GetItem(1, MisspelledWordKind.Normal)
If result IsNot Nothing Then result.Select()