This is the code that simulates multiple assigning of the spell-checked control:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
public RadForm1()
{
InitializeComponent();
this.textBox1.MouseEnter += Control_Enter;
this.textBox1.MouseLeave += Control_Leave;
}
bool hasLoop = false;
private void Control_Enter(object sender, EventArgs e)
{
radSpellChecker1.AutoSpellCheckControl = sender;
if (hasLoop)
{
return;
}
for (int i = 0; i < 1000; i++)
{
if (i % 2 == 0)
{
radSpellChecker1.AutoSpellCheckControl = null;
}
else
{
radSpellChecker1.AutoSpellCheckControl = sender;
}
}
hasLoop = true;
}
private void Control_Leave(object sender, EventArgs e)
{
radSpellChecker1.AutoSpellCheckControl = null;
}
}