I try to set the spelling options, but no matter what, it follows the default behaviour described in
http://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraSpellCheckerOptionsSpellingtopic
Whether I set the following values to True or False, doesn't change the behaviour (of check-as-you-type - that is the only spelling functionality that's relevant for us)
Code snippet:
DevExpress.XtraSpellChecker.OptionsSpelling spellOptions = new DevExpress.XtraSpellChecker.OptionsSpelling();
spellOptions.IgnoreEmails = DevExpress.Utils.DefaultBoolean.True;
spellOptions.IgnoreMixedCaseWords = DevExpress.Utils.DefaultBoolean.True;
spellOptions.IgnoreRepeatedWords = DevExpress.Utils.DefaultBoolean.True;
spellOptions.IgnoreUpperCaseWords = DevExpress.Utils.DefaultBoolean.True;
spellOptions.IgnoreUrls = DevExpress.Utils.DefaultBoolean.True;
spellOptions.IgnoreWordsWithNumbers = DevExpress.Utils.DefaultBoolean.True;
this.spellChecker1.SetSpellCheckerOptions(this, spellOptions);
this.richEditControl1.SpellChecker = this.spellChecker1;
BR,
Johan Andersen
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Johan,
Thank you for your code snippet. This problem is caused by the fact that you pass 'this' to the SpellChecker.SetSpellCheckerOptions() method. It is necessary to pass the checked control (RichEdintControl in your scenario) to this method. Please update your code as follows to fix this problem:
... this.spellChecker1.SetSpellCheckerOptions(this.richEditControl1, spellOptions);
Hope this helps you.
Thanks,
Alessandro.
Thanks for the fast reply. That did indeed solve my problem.
BUT, FUI, there is still a problem if I try to set the spelling options in the .cs[Design] view.
If I e.g. set all the spelling options to False in the design view, then the generated code in .Designer.cs looks like this:
//
// spellChecker1
//
this.spellChecker1.Culture = new System.Globalization.CultureInfo("da-DK");
this.spellChecker1.OptionsSpelling.IgnoreEmails = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreMixedCaseWords = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreRepeatedWords = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreUpperCaseWords = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreUrls = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreWordsWithNumbers = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.ParentContainer = null;
this.spellChecker1.SpellCheckMode = DevExpress.XtraSpellChecker.SpellCheckMode.AsYouType;
//
// barManager1
// And later spellChecker1 is set to be used by our edit control:
this.richEditControl1.SpellChecker = this.spellChecker1;
If one should always use
spellChecker1.SetSpellCheckerOptions
instead of just setting
this.spellChecker1.OptionsSpelling.IgnoreEmails etc.,
then maybe these should not be writable?? (if that's what's the problem here.)
BR,
Johan
Hello Johan,
By default, the options specified via the SpellChecker.OptionsSpelling property are used when checking a control. However, you can override these options for a particular control by calling the SpellChecker.SetSpellCheckerOptions() method with this control passed to this method as a parameter. Attached is a small sample, illustrating my statements in action. Does this help you?
Thanks,
Alessandro.
Hello Allesandro,
My point is that if it has no effect to do this:
this.spellChecker1.OptionsSpelling.IgnoreEmails = DevExpress.Utils.DefaultBoolean.False;
this.spellChecker1.OptionsSpelling.IgnoreMixedCaseWords = DevExpress.Utils.DefaultBoolean.False;
Then maybe you shouldn't allow programmars to do so. That way you can force programmars to use setSpellingOptions() in stead.
For me it's not a problem. It was just a suggestion to make it easier for your other customers that are going to use this in the future.
BR,
Johan
Hello Johan,
Thank you for the update. Basically, the default SpellChecker.OptionsSpelling settings affect a particular control if they are adjusted before calling the SpellChecker.Check() method for this control. After this method is called, the XtraSpellChecker constructs an the internal set of settings for the given control (this set is based on the SpellChecker.OptionsSpelling settings). This set can be modified further only via the explicite SpellChecker.SetSpellCheckerOptions() method call. Please let me know whether you need further clarification on this question. I will be glad to help you.
Thanks,
Alessandro.