Yogesh

Yogesh

  • NA
  • 1
  • 3k

Issue with validating multiple textboxes for spell check using Netspell's SpellChecker control

Nov 3 2011 2:36 AM


Description:-

on a 'Spell Check' button click , we want to spell check one by one textboxes present on a form.


Issues:-

On button click event, we are using a foreach loop , to iterate through the controls present on a form as follows,
               
// I am calling this function on Spell Check button click event.

      private void CheckTextBox()
      {
          foreach (Control cnt in Controls)
          {
              if (cnt is TextBox)
             {
                // To open a popup for spell check.
                SpellChecker.SpellCheck(cnt.Text);
             }
          }
      }                             

The problem is foreach loop , loops through all the textboxes, and when last textbox comes, it opens a SpellCheker popup. So i can't test all the
textboxes one by one on a single click.


Answers (1)