windowsforms-5136-controls-and-libraries-spell-checker-examples-how-to-customize-the-spelling-options-dialog.md
The following example demonstrates how to customize the Spelling Options Dialog by doing the following.
private void spellChecker1_OptionsFormShowing(object sender, DevExpress.XtraSpellChecker.FormShowingEventArgs e)
{
var optionsForm = spellChecker1.FormsManager.OptionsForm;
// You can hide the 'Add' button
spellChecker1.FormsManager.SpellCheckForm.Controls["btnAdd"].Visible = false;
// Or suppress the entire panel
GroupControl grpEditCustomDic = optionsForm.Controls.Find("grpEditCustomDic", true)[0] as GroupControl;
grpEditCustomDic.Visible = false;
optionsForm.Controls.Find("grpInternationDocs", true)[0].Top = grpEditCustomDic.Top;
optionsForm.Controls.Find("xtraTabControl1", true)[0].Height -= grpEditCustomDic.Height;
optionsForm.Height -= grpEditCustomDic.Height;
}
Private Sub spellChecker1_OptionsFormShowing(ByVal sender As Object, ByVal e As DevExpress.XtraSpellChecker.FormShowingEventArgs) Handles spellChecker1.OptionsFormShowing
Dim optionsForm = spellChecker1.FormsManager.OptionsForm
' You can hide the 'Add' button
spellChecker1.FormsManager.SpellCheckForm.Controls("btnAdd").Visible = False
' Or suppress the entire panel
Dim grpEditCustomDic As GroupControl = TryCast(optionsForm.Controls.Find("grpEditCustomDic", True)(0), GroupControl)
grpEditCustomDic.Visible = False
optionsForm.Controls.Find("grpInternationDocs", True)(0).Top = grpEditCustomDic.Top
optionsForm.Controls.Find("xtraTabControl1", True)(0).Height -= grpEditCustomDic.Height
optionsForm.Height -= grpEditCustomDic.Height
End Sub
The image below demonstrates a customized Spelling Options Dialog.
The code sample above utilizes default control names to access them. The following table gives names for all of these default controls owned by a Spelling Options dialog.
| Element Caption | Control | Name |
|---|---|---|
| Spelling tab | XtraTabControl | xtraTabControl1 |
| Spelling tab page | XtraTabPage | xtraTabPage1 |
| Apply button | SimpleButton | btnApply |
| Cancel button | SimpleButton | btnCancel |
| OK button | SimpleButton | btnOK |
| General Options group | GroupControl | grpGeneral |
| Ignore E-mails check edit | CheckEdit | chkEmails |
| Ignore Words With MiXeDcASe check edit | CheckEdit | chkMixedCase |
| Ignore words with numbers check edit | CheckEdit | chkNumbers |
| Ignore repeated words check edit | CheckEdit | chkRepeatedWords |
| Ignore words in UPPERCASE check edit | CheckEdit | chkUpperCase |
| Ignore Internet and file addresses check edit | CheckEdit | chkWebSites |
| Edit Custom Dictionary group | GroupControl | grpEditCustomDic |
| Add, change or remove words from your custom dictionary | Label | lblChange |
| Edit button | SimpleButton | btnEditDictionary |
| International Dictionaries group | GroupControl | grpInternationDocs |
| Choose the dictionary to use when checking your spelling | Label | lblChooseDic |
| Language | Label | lblLanguage |
| Language combo box edit | ComboBoxEdit | cbLanguage |