TX Spell .NET for Windows Forms

GetMenuItems Method

Method|Introduced in 3.0
Namespace
TXTextControl.Proofing
Package
TXTextControl.TXSpell.WinForms.SDK as TXSpell.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.

Syntax

GetMenuItems(object, object, int)

Returns an array of MenuItems for a specific object of type TXTextControl.MisspelledWord.

public MenuItem[] GetMenuItems(object misspelledWord, object textControl, int maxSuggestions);
ParameterDescription
misspelledWord

The misspelled word of type TXTextControl.MisspelledWord for that the array of menu items are created.

textControl

The control of type TXTextControl.TextControl that contains the misspelled word.

maxSuggestions

The maximum number of suggestions that should be created for the incorrect word.

GetMenuItems(IncorrectWord, string, int)

Returns an array of MenuItems for a specific IncorrectWord.

public MenuItem[] GetMenuItems(IncorrectWord incorrectWord, string sourceText, int maxSuggestions);
ParameterDescription
incorrectWord

The misspelled word of type IncorrectWord for that the array of menu items is created.

sourceText

The text that contains the misspelled word.

maxSuggestions

The maximum number of suggestions that should be created for the incorrect word.

Return Value

The array of type MenuItem for the specified misspelled word.

Examples

The following example retrieves menu items from the txspell checker.

TXTextControl.Proofing.MenuItem[] results = tXSpellChecker.GetMenuItems(new TXTextControl.Proofing.IncorrectWord(), "Quarterly results", 10);
foreach (TXTextControl.Proofing.MenuItem menuItem in results)
{
    Console.WriteLine(menuItem);
}