SpellCheckingWindowsStyle Example

3 posts, 0 answers
  1. Tony
    Tony avatar
    24 posts
    Member since:
    Nov 2011

    Posted 18 Feb 2014 Link to this post

    Is there an example of setting the SpellCheckingWindowsStyle  for the RadSpellChecker?  Im using example in another thread of spell checking multiple text boxes..  My code is as follows - Im just not sure how to style the spell checker and what properties are available. Can I have an example?


    public partial class MainPage : UserControl
        public MainPage()
            RadSpellChecker.SpellCheckingCompleted += spellCheckingCompleted;
            textBoxes = new List<TextBox>();
        int i;
        List<TextBox> textBoxes;
        private void button1_Click(object sender, RoutedEventArgs e)
            RadSpellChecker.WindowSettings.ShowAlertWhenSpellCheckingCompleted = false;
            RadSpellChecker.Check(this.textBox1, SpellCheckingMode.AllAtOnce);
        private void spellCheckingCompleted(object sender, SpellCheckingCompletedEventArgs args)
            if (i == 2)
                i = 0;
            RadSpellChecker.Check(this.textBoxes[i], SpellCheckingMode.AllAtOnce);
  2. Tony
    Tony avatar
    24 posts
    Member since:
    Nov 2011

    Posted 18 Feb 2014 in reply to Tony Link to this post

    More specifically, I really need to set the foreground color for the textbox containing "Not in Dictionary". (Im using the No-Xaml libraries).  In my app.xaml, I set a global color for text boxes to be:

     <Style TargetType="TextBlock" BasedOn="{StaticResource TextBaseStyle}">
    <Setter Property="Foreground" Value="White" />

    The issue is that the text the labels and text for "not in dictionary" are white.  How can I customize this to be black using the SpellCheckingWindowsStyle?
  3. Todor
    Todor avatar
    168 posts

    Posted 21 Feb 2014 Link to this post

    Hello Tony,

    Thank you for contacting us.

    Unfortunately, there isn't a way to apply different styles for the same controls in the RadSpellChecker. This means that every control of a given type will have the same style inside the control. 

    If you want to style the TextBox control you can base your own style on the 'TextBoxStyle' which is provided by us and is placed in System.Windows.xaml file. This file is a resource dictionary which contains styles for some of the native MS controls. Here you can find the full list of styled controls.

    Anyway, the TextBox on which you want to change the Foreground property is in ReadOnly state, but unfortunately even you set that property in its Template's VisualState on the element in the control template which is responsible for displaying the text, the internal MS control TextBoxView is not updated. It gets only the TextBox's Foreground property value which is set through the style setter or locally. This is a limitation of the TextBox control.

    I hope this information will be helpful.
    If you need further assistance, please contact us again.

Back to Top