How to: Customize the Spelling Options Dialog
- 2 minutes to read
The following example demonstrates how to customize the Spelling Options Dialog by doing the following.
- Handle the SpellChecker.OptionsFormShowing event. It is raised when the form is about to be shown.
- Retrieve the Spelling Options Dialog’s form from the SpellChecker.FormsManager collection.
- Modify the form’s Controls collection to hide default controls and/or to add custom one. To retrieve the desired default control, call the Find method.
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;
}
The image below demonstrates a customized Spelling Options Dialog.
#Table of Controls
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 | Xtra |
xtra |
Spelling tab page | Xtra |
xtra |
Apply button | Simple |
btn |
Cancel button | Simple |
btn |
OK button | Simple |
btn |
General Options group | Group |
grp |
Ignore E-mails check edit | Check |
chk |
Ignore Words With Mi |
Check |
chk |
Ignore words with numbers check edit | Check |
chk |
Ignore repeated words check edit | Check |
chk |
Ignore words in UPPERCASE check edit | Check |
chk |
Ignore Internet and file addresses check edit | Check |
chk |
Edit Custom Dictionary group | Group |
grp |
Add, change or remove words from your custom dictionary | Label | lbl |
Edit button | Simple |
btn |
International Dictionaries group | Group |
grp |
Choose the dictionary to use when checking your spelling | Label | lbl |
Language | Label | lbl |
Language combo box edit | Combo |
cb |