Version

WordCorrected Event (UltraSpellChecker)

Fired when the user picks a new word to replace a misspelled word.
Syntax
'Declaration
 
Public Event WordCorrected As WordCorrectedEventHandler
public event WordCorrectedEventHandler WordCorrected
Event Data

The event handler receives an argument of type WordCorrectedEventArgs containing data related to this event. The following WordCorrectedEventArgs properties provide information specific to this event.

PropertyDescription
CorrectedWord Gets the new word after the user has corrected it.
OriginalWord Gets the original word before it was corrected.
Source Gets the reason why the word was corrected.
SpellCheckTarget (Inherited from Infragistics.Win.UltraWinSpellChecker.SpellCheckTargetEventArgs)Gets the object which was spell checked.
Remarks
This occus if a word is corrected while the user is typing or through the spell checking dialog.
Example
This sample shows how to determine when words are corrected and how that correction was initiated.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.UltraWinSpellChecker

Private Sub spellChecker_WordCorrected(ByVal sender As System.Object, ByVal e As WordCorrectedEventArgs) Handles spellChecker.WordCorrected

	If (e.Source = WordCorrectionSource.SpellCheckDialog) Then

		MessageBox.Show( _
			"The user has choosen to correct """ + _
			e.OriginalWord + _
			""" with """ + _
			e.CorrectedWord + _
			""" through the spell check dialog.")

	ElseIf (e.Source = WordCorrectionSource.SpellErrorEvent) Then

		MessageBox.Show( _
			"The word """ + _
			e.OriginalWord + _
			""" has been automatically corrected to """ + _
			e.CorrectedWord + _
			""" through the SpellError event.")

	End If

End Sub
using System.Windows.Forms;
using Infragistics.Win.UltraWinSpellChecker;

private void spellChecker_WordCorrected( object sender, WordCorrectedEventArgs e )
{
	if ( e.Source == WordCorrectionSource.SpellCheckDialog )
	{
		MessageBox.Show(
			"The user has choosen to correct \"" +
			e.OriginalWord +
			"\" with \"" +
			e.CorrectedWord +
			"\" through the spell check dialog." );
	}
	else if ( e.Source == WordCorrectionSource.SpellErrorEvent )
	{
		MessageBox.Show(
			"The word \"" +
			e.OriginalWord +
			"\" has been automatically corrected to \"" +
			e.CorrectedWord +
			"\" through the SpellError event." );
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also