Hi,
hmmm... here is what I do. I put a textbox to a
form and make it multiline. Then I put correct text into textbox and append
incorrect word to the text, so bad word is out of visible area. Enable
scrollbar. Make a check.
When incorrect word is encountered, BadWord event
is fired, then textbox is scrolled to this word, then BadWordDialog is
shown.
Sample is simple, contains C1Spell, button
and textbox on a form. Below is the code:
private void button1_Click(object sender, EventArgs
e)
{
c1Spell1.CheckControl(textBox1);
}
private void c1Spell1_BadWord(object sender,
C1.Win.C1Spell.BadWordEventArgs
e)
{
textBox1.ScrollToCaret();
}
TextBox settings:
private void InitializeComponent()
{
...
this.textBox1.Location = new System.Drawing.Point(13, 13);
this.textBox1.Multiline = true;
this.textBox1.Name =
"textBox1";
this.textBox1.ScrollBars =
System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new
System.Drawing.Size(140, 60);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "good good good good good good good good good good
good
good good good good good good good good good good good good good good
good
good good good good good good good good good good good good good good
good
good badd badd good";
...
}
Regards,
Sergey.
P.S. What version of C1Spell do you use?
Thanks
but that did not work for me, the code is okay but it didn't do what I wanted
to do. That is to scroll to the selected text that the spell check has
selected as the current word being spell checked. My problem is that
when spell checking words within a multiline text box with scroll bars, if the
word is located off the visible area of the multi text box then spell check
doesn't auto scroll to it even though spell check is doing the spell checking
on that word. The code you provided above would work if the caret cursor
was at the selected text but it's not. Looks like spell check just
highlights the word, fires badword event if any and throws the spell check
dialog up.
http://home.componentone.com/cs/forums/186946/ShowPost.aspx#186992