Using WPF SpellChecker in Winform App

2 posts, 1 answers
  1. Patrick
    Patrick avatar
    42 posts
    Member since:
    Jul 2012

    Posted 30 Aug 2012 Link to this post

    Due to some limitations and issues with the Winform version of RadSpellChecker I started investigating using the WPF version instead through an ElementHost. 
    I discovered that I didn't need the ElementHost and that I could get the WPF RadSpellChecker to take my text and "pop up" by doing the following:
    • Added Reference to "Telerik.Windows.Documents.Proofing"
    • Added Using of "Telerik.Windows.Controls"
    • Created WPF Textbox like so --> var txtControl = new System.Windows.Controls.TextBox();
    • Assigned some test text to it --> txtControl.Text = "This isn't speelt rite.";
    • Ran the static Check() method --> RadSpellChecker.Check(txtControl, SpellCheckingMode.AllAtOnce);

    This almost works, I get the SpellCheck window with my text in it but there aren't any words in the dictionary.  Because of the way I'm doing it would I need to add the base English Dictionary back in?  Am I making some other rookie mistake?  Attached is an image of what I am seeing and below is the simple code snippet in it's entirety.

    var txtControl=new System.Windows.Controls.TextBox();
    txtControl.Text="This isn't speelt rite.";
    RadSpellChecker.Check(txtControl, SpellCheckingMode.AllAtOnce);

    P.S. I didn't know if this belonged in the Winform or WPF forum, sorry.

  2. Answer
    Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 03 Sep 2012 Link to this post

    Hi Patrick,

    The dictionaries that RadSpellChecker uses are separated from the implementation of the control. An En-US dictionary is distributed with RadControls for WPF, but it is in a different assembly than the spell checker and you should add a reference to the Telerik.Windows.Documents.Proofing.Dictionaries.En-US assembly.

    You can read more about multi-language support and loading dictionaries for spell checking here.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top