Version

SpellChecking Event

Fired when all or a part of text is about to be spell checked.
Syntax
'Declaration
 
Public Event SpellChecking As SpellCheckingEventHandler
public event SpellCheckingEventHandler SpellChecking
Event Data

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

PropertyDescription
Cancel Gets or sets whether or not to cancel the spell checking of an object.
Length (Inherited from Infragistics.Win.UltraWinSpellChecker.SpellCheckTextEventArgs)Gets the length of the spell checked text portion.
Offset (Inherited from Infragistics.Win.UltraWinSpellChecker.SpellCheckTextEventArgs)Gets the offset in the Text where the spell checked text portion begins.
SpellCheckTarget (Inherited from Infragistics.Win.UltraWinSpellChecker.SpellCheckTargetEventArgs)Gets the object which was spell checked.
Text (Inherited from Infragistics.Win.UltraWinSpellChecker.SpellCheckTextEventArgs)Gets the full text of the target being spell checked.
Remarks

This event fires any time the UltraSpellChecker attempts to spell check the text of a spell checked object.

Example
This sample shows how to determine when the spell checker is about to spell check text and when it has completed spell checking text.

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_SpellChecking(ByVal sender As System.Object, ByVal e As SpellCheckingEventArgs) Handles spellChecker.SpellChecking
	Debug.WriteLine("The following text has been spell checked: """ + e.Text.Substring(e.Offset, e.Length) + """")
End Sub

Private Sub spellChecker_SpellChecked(ByVal sender As System.Object, ByVal e As SpellCheckedEventArgs) Handles spellChecker.SpellChecked
	Debug.WriteLine( _
		"The following text has been spell checked: """ + _
		e.Text.Substring(e.Offset, e.Length) + _
		""" and " + e.Errors.Count.ToString() + _
		" errors were found.")
End Sub
using System.Diagnostics;
using System.Windows.Forms;
using Infragistics.Win.UltraWinSpellChecker;

private void spellChecker_SpellChecking( object sender, SpellCheckingEventArgs e )
{
	Debug.WriteLine( "The following text will been spell checked: \"" + e.Text.Substring( e.Offset, e.Length ) + "\"" );
}

private void spellChecker_SpellChecked( object sender, SpellCheckedEventArgs e )
{
	Debug.WriteLine( 
		"The following text has been spell checked: \"" + 
		e.Text.Substring( e.Offset, e.Length ) + 
		"\" and " + e.Errors.Count + 
		" errors were found." );
}
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