[]
Shows a spell-checking dialog for an editor and returns the number of spelling errors found.
public int CheckControl(ISpellCheckableEditor editor, bool fromCursor, ISpellDialog dlg)
Public Function CheckControl(editor As ISpellCheckableEditor, fromCursor As Boolean, dlg As ISpellDialog) As Integer
| Type | Name | Description |
|---|---|---|
| ISpellCheckableEditor | editor | ISpellCheckableEditor that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| ISpellDialog | dlg | Dialog that implements the ISpellDialog interface used for displaying and correcting errors. |
| Type | Description |
|---|---|
| int | The number of errors found, or -1 if the dialog was canceled. |
For an example, see the CheckControl(TextBoxBase, bool, ISpellDialog) method.
Shows a spell-checking dialog for an editor and returns the number of spelling errors found.
public int CheckControl(ISpellCheckableEditor editor, bool fromCursor)
Public Function CheckControl(editor As ISpellCheckableEditor, fromCursor As Boolean) As Integer
| Type | Name | Description |
|---|---|---|
| ISpellCheckableEditor | editor | ISpellCheckableEditor that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| Type | Description |
|---|---|
| int | The number of errors found, or -1 if the dialog was canceled. |
For an example, see the CheckControl(TextBoxBase, bool, ISpellDialog) method.
Shows a spell-checking dialog for an editor and returns the number of spelling errors found.
public int CheckControl(ISpellCheckableEditor editor)
Public Function CheckControl(editor As ISpellCheckableEditor) As Integer
| Type | Name | Description |
|---|---|---|
| ISpellCheckableEditor | editor | ISpellCheckableEditor that contains the text to be spell-checked. |
| Type | Description |
|---|---|
| int | The number of errors found, or -1 if the dialog was canceled. |
Shows a spell-checking dialog for an editor, returns the number of spelling errors found.
public int CheckControl(TextBoxBase editor, bool fromCursor, ISpellDialog dlg)
Public Function CheckControl(editor As TextBoxBase, fromCursor As Boolean, dlg As ISpellDialog) As Integer
| Type | Name | Description |
|---|---|---|
| TextBoxBase | editor | TextBoxBase control that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| ISpellDialog | dlg | Dialog that implements the ISpellDialog interface used for displaying and correcting errors. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
You can use this method to invoke the spell-checker using a custom spell dialog, or using the built-in C1SpellDialog.
The code below uses the CheckControl method with an instance of the C1SpellDialog and attaches some event handlers to display the spell-checking progress in a status bar.
private void btnSpell_Click(object sender, EventArgs e)
{
// create spell-checking dialog
using (C1SpellDialog dlg = new C1SpellDialog())
{
// connect event handler
dlg.ErrorDisplayed += new EventHandler(dlg_ErrorDisplayed);
// spell-check the 'textBox' control
c1SpellChecker1.CheckControl(this.textBox, false, dlg);
}
}
void dlg_ErrorDisplayed(object sender, EventArgs e)
{
// get the C1SpellDialog that fired the event
C1SpellDialog dlg = sender as C1SpellDialog;
// show information about the error currently displayed
statusLabel1.Text = string.Format("Error {0} of {1}: '{2}'",
dlg.ErrorIndex + 1, dlg.ErrorCount, dlg.CurrentError.Text);
}
Shows a spell-checking dialog for an editor, returns the number of spelling errors found.
public int CheckControl(TextBoxBase editor, bool fromCursor)
Public Function CheckControl(editor As TextBoxBase, fromCursor As Boolean) As Integer
| Type | Name | Description |
|---|---|---|
| TextBoxBase | editor | TextBoxBase control that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for an editor, returns the number of spelling errors found.
public int CheckControl(TextBoxBase editor)
Public Function CheckControl(editor As TextBoxBase) As Integer
| Type | Name | Description |
|---|---|---|
| TextBoxBase | editor | TextBoxBase control that contains the text to be spell-checked. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a browser, returns the number of spelling errors found.
public int CheckControl(WebBrowser browser)
Public Function CheckControl(browser As WebBrowser) As Integer
| Type | Name | Description |
|---|---|---|
| WebBrowser | browser | WebBrowser control that contains the text to be spell-checked. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a browser, returns the number of spelling errors found.
public int CheckControl(WebBrowser browser, bool fromCursor)
Public Function CheckControl(browser As WebBrowser, fromCursor As Boolean) As Integer
| Type | Name | Description |
|---|---|---|
| WebBrowser | browser | WebBrowser control that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a browser, returns the number of spelling errors found.
public int CheckControl(WebBrowser browser, bool fromCursor, ISpellDialog dlg)
Public Function CheckControl(browser As WebBrowser, fromCursor As Boolean, dlg As ISpellDialog) As Integer
| Type | Name | Description |
|---|---|---|
| WebBrowser | browser | WebBrowser control that contains the text to be spell-checked. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| ISpellDialog | dlg | Dialog that implements the ISpellDialog interface used for displaying and correcting errors. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.
public int CheckControl(Control control, object browser)
Public Function CheckControl(control As Control, browser As Object) As Integer
| Type | Name | Description |
|---|---|---|
| Control | control | Control control that is used as a parent to show a spell checking dialog. |
| object | browser | Reference to an IWebBrowser2 interface. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.
public int CheckControl(Control control, object browser, bool fromCursor)
Public Function CheckControl(control As Control, browser As Object, fromCursor As Boolean) As Integer
| Type | Name | Description |
|---|---|---|
| Control | control | Control control that is used as a parent to show a spell checking dialog. |
| object | browser | Reference to an IWebBrowser2 interface. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |
Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.
public int CheckControl(Control control, object browser, bool fromCursor, ISpellDialog dlg)
Public Function CheckControl(control As Control, browser As Object, fromCursor As Boolean, dlg As ISpellDialog) As Integer
| Type | Name | Description |
|---|---|---|
| Control | control | Control control that is used as a parent to show a spell checking dialog. |
| object | browser | Reference to an IWebBrowser2 interface. |
| bool | fromCursor | Whether to check only from the cursor position or the entire control contents. |
| ISpellDialog | dlg | Dialog that implements the ISpellDialog interface used for displaying and correcting errors. |
| Type | Description |
|---|---|
| int | The number of errors found, -1 if the dialog was canceled. |