//------------------------------------------------------------
        #region ** modal spell-checking

        private void _btnModal_Click(object sender, RoutedEventArgs e)
        {
            // select control to spell-check
            object editor = null;

            switch (_cmbControl.SelectedIndex)
            {
            case 0:
                editor = _plainTextBox;
                break;

            case 1:
                editor = _richTextBox;
                break;

            case 2:
                editor = new DataGridSpellWrapper(_dataGrid);
                break;
            }

            // select type of modal dialog to use
            C1Window dialog = null;

            switch (_cmbDialog.SelectedIndex)
            {
            // C1SpellChecker built-in dialog
            case 0:
                dialog = new C1SpellDialog();
                break;

            // Customized C1SpellChecker built-in dialog
            case 1:
                dialog        = new C1SpellDialog();
                dialog.Header = "Customized Caption!";
                break;

            // Standard dialog
            case 2:
                dialog = new StandardSpellDialog();
                break;

            // Word-style dialog
            case 3:
                dialog = new WordSpellDialog();
                break;
            }

            // spell-check the control
            _c1SpellChecker.CheckControlAsync(editor, false, (ISpellDialog)dialog);
        }
        private void _btnModal_Click(object sender, RoutedEventArgs e)
        {
            // select control to spell-check
            object editor = null;
            switch (_cmbControl.SelectedIndex)
            {
                case 0:
                    editor = _plainTextBox;
                    break;
                case 1:
                    editor = _richTextBox;
                    break;
                case 2:
                    editor = new DataGridSpellWrapper(_dataGrid);
                    break;
            }

            // select type of modal dialog to use
            C1Window dialog = null;
            switch (_cmbDialog.SelectedIndex)
            {
                // C1SpellChecker built-in dialog
                case 0:
                    dialog = new C1SpellDialog();
                    break;

                // Customized C1SpellChecker built-in dialog
                case 1:
                    dialog = new C1SpellDialog();
                    dialog.Header = "Customized Caption!";
                    break;

                // Standard dialog
                case 2:
                    dialog = new StandardSpellDialog();
                    break;

                // Word-style dialog
                case 3:
                    dialog = new WordSpellDialog();
                    break;
            }

            // spell-check the control
            _c1SpellChecker.CheckControlAsync(editor, false, (ISpellDialog)dialog);
        }