Note: it should be closed automatically when all words are corrected.
To reproduce:
1. Enter some misspelled words and open the context menu with right mouse click.
2. Show the SpellCheckingDialog.
3. Add a word to the dictionary. The SpellCheckingDialog will be closed immediately. However, if you press to ignore the word/words, the dialog remains opened.
Workaround: cancel the SpellCheckingDialog.FormClosing event except when the close button is clicked:
public Form1()
{
InitializeComponent();
this.radRichTextEditor1.IsSpellCheckingEnabled = true;
RadButton buttonClose = ((SpellCheckingDialog)this.radRichTextEditor1.RichTextBoxElement.SpellCheckingDialog).Controls["buttonClose"] as RadButton;
buttonClose.MouseDown += buttonClose_MouseDown;
((SpellCheckingDialog)this.radRichTextEditor1.RichTextBoxElement.SpellCheckingDialog).FormClosing += SpellCheckingDialog_FormClosing;
}
bool shouldClose = false;
private void buttonClose_MouseDown(object sender, MouseEventArgs e)
{
shouldClose = true;
}
private void SpellCheckingDialog_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.FormOwnerClosing)
{
e.Cancel = !shouldClose;
shouldClose = false;
}
}