Spell Check Uppercase Words and WordsWithNumbers

7 posts, 0 answers
  1. Luis
    Luis avatar
    3 posts
    Member since:
    Jun 2015

    Posted 23 Jun 2015 Link to this post

    Hi Team!

     Is their a way on how to used the SpellCheckUppercaseWords and SpellCheckWordsWithNumbers property under the namespace Telerik.WinForms.Documents.Proofing while I am using Telerik.WinControls.RichTextBox.Proofing for loading the spell check custom library. As i tried WinControls.RichTextBox.Proofing does not contains a member of DocumentSpellChecker.Settings so therefore I cannot use this way of using the property DocumentSpellChecker.Settings.SpellCheckUppercaseWords = True for allowing uppercase spell check. See below part of my code.

     //Setting up spell check.

     Friend Shared SpellCheckCulture As CultureInfo = CultureInfo.GetCultureInfo("en-GB")

     

    Dim textBoxControlSpellChecker As IControlSpellChecker = Me.RadSpellCheck.GetControlSpellChecker(GetType(TextBox))
    Dim documentSpellChecker As DocumentSpellChecker = TryCast(textBoxControlSpellChecker.SpellChecker, DocumentSpellChecker)

    documentSpellChecker.Settings.SpellCheckUppercaseWords = True   //This part will got an error if I import Telerik.WinControls.RichTextBox.Proofing

    documentSpellChecker.AddDictionary(New SpellCheckDictionary(), SpellCheckCulture)

    documentSpellChecker.SpellCheckingCulture = SpellCheckCulture

     

    //Loading of Custom Library using Telerik.WinControls.RichTextBox.Proofing

    Public Class SpellCheckDictionary
            Inherits WordDictionary
            Protected Overrides Sub EnsureDictionaryLoadedOverride()

                Try

                    Using ms As MemoryStream = New MemoryStream(File.ReadAllBytes("en-GB.tdf"))
                        Me.Load(ms)
                    End Using

                Catch ex As Exception
                    Glenfield.Common.HandleError(ex)
                End Try

            End Sub
        End Class

  2. Hristo
    Admin
    Hristo avatar
    1506 posts

    Posted 24 Jun 2015 Link to this post

    Hi Luis,

    Thank you for writing.

    Please note that the RadRichTextBox control is obsolete since our Q3 2014 release. The required settings is only available for the RadRichTextEditor and it is located in the Telerik.WinForms.Documents.Proofing namespace. Please check the following documentation article explaining how the SpellCheck functionality works: RadRichTextEditor | SpellCheck 

    I created a simple example demonstrating how your task can be achieved using RadRichTextEditor
    Private Sub SetDictionaryPref(radRichTextEditor As RadRichTextEditor)
        Dim spellCheckCulture As CultureInfo = CultureInfo.GetCultureInfo("en-GB")
        Dim dictionary = Me.GetDictionary()
        If dictionary IsNot Nothing Then
            CType(radRichTextEditor.SpellChecker, DocumentSpellChecker).AddDictionary(dictionary, spellCheckCulture)
            Dim documentSpellChecker As DocumentSpellChecker = TryCast(radRichTextEditor.SpellChecker, DocumentSpellChecker)
            documentSpellChecker.Settings.SpellCheckUppercaseWords = True
        End If
    End Sub
     
    Private Function GetDictionary() As RadDictionary
        Dim dictionary As New RadDictionary
        Try
            Using ms As MemoryStream = New MemoryStream(File.ReadAllBytes("en-GB.tdf"))
                dictionary.Load(ms)
            End Using
     
            Return dictionary
        Catch ex As Exception
            Return Nothing
        End Try
    End Function

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Luis
    Luis avatar
    3 posts
    Member since:
    Jun 2015

    Posted 25 Jun 2015 in reply to Hristo Link to this post

     Hi Hristo,

    Thank you for the prompt response.

    In relation with the above concern, before I used MS multi line TextBox, but to work with the above suggestions i change to RadRichTextbox but i found differences in font size, even though the font settings are all the same as MS TextBox. How do I work this out in RadRichTextBox, is there any other settings or property do i have to set.

     

     

  4. Hristo
    Admin
    Hristo avatar
    1506 posts

    Posted 30 Jun 2015 Link to this post

    Hello Luis,

    Thank you for writing back. 

    I did not observe issues with the font size of the content in RadRichTextBox. As I mentioned earlier the control is obsolete and is not being further developed.

    If possible, I suggest you to switch to the more advanced RadRichTextEditor. In case you insist on staying with RadRichTextBox here is an article explaining the spellchecking feature: http://www.telerik.com/help/winforms/richtextbox-features-spellcheck.html

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Guillermo
    Guillermo avatar
    4 posts
    Member since:
    Nov 2018

    Posted 16 Apr in reply to Hristo Link to this post

    Hi Hristo!, I'm trying to use SpellChecker with RadTextBox in mode "word by word", it works ok except when RadTextBox control has the property CharacterCasing set to "Upper". My DocumentSpellChecker object hasn't a property named "Settings" to set the property "SpellCheckUppercaseWords", Code example: spcValor is RadSpellChecker control, txt_valor is RadTextBox control:

    Thank you very much.

    spcValor.AutoSpellCheckControl = txt_valor
    setearDiccionario(spcValor)
    ...
     Public Shared Sub setearDiccionario(ByRef ao_spcControl As Telerik.WinControls.UI.RadSpellChecker)
       Dim lo_textBoxControlSpellChecker As Telerik.WinControls.UI.IControlSpellChecker = ao_spcControl.GetControlSpellChecker(GetType(Telerik.WinControls.UI.RadTextBox))
       Dim lo_documentSpellChecker As Telerik.WinControls.SpellChecker.Proofing.DocumentSpellChecker = TryCast(lo_textBoxControlSpellChecker.SpellChecker,Telerik.WinControls.SpellChecker.Proofing.DocumentSpelChecker)
       lo_documentSpellChecker.AddDictionary(New MySpanishDictionary(), CulturaEspanol)
    End Sub
  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3198 posts

    Posted 17 Apr Link to this post

    Hello, Guillermo,     

    RadRichTextEditor has its own spellchecking functionality which is not related to the functionality provided by RadSpellChecker. That is why the SpellCheckUppercaseWords is missing for RadSpellChecker. However, if you need to enable the upper casing for your specific case, please refer to the following code snippet how to do it: 

    Friend Shared CulturaEspanol As CultureInfo = CultureInfo.GetCultureInfo("es-ES")
    Sub New()
     
        InitializeComponent()
        Me.RadSpellChecker1.SpellCheckMode = Telerik.WinControls.UI.SpellCheckMode.WordByWord
        Me.RadSpellChecker1.AutoSpellCheckControl = Me.RadTextBox1
     
        Threading.Thread.CurrentThread.CurrentCulture   = CulturaEspanol
         
        Me.RadTextBox1.CharacterCasing = CharacterCasing.Upper
        Dim textBoxControlSpellChecker As TextBoxSpellChecker = Me.RadSpellChecker1.GetControlSpellChecker(GetType(RadTextBox))
        Dim documentSpellChecker As DocumentSpellChecker = TryCast(textBoxControlSpellChecker.SpellChecker, DocumentSpellChecker)
        textBoxControlSpellChecker.ShowAllCapitalLettersWord=True
        documentSpellChecker.SpellCheckingCulture= CulturaEspanol 
        documentSpellChecker.AddDictionary(New MySpanishDictionary(), CulturaEspanol)
     
    End Sub
     
    Public Class MySpanishDictionary
    Inherits WordDictionary
        Protected Overrides Sub EnsureDictionaryLoadedOverride()
            Using ms As MemoryStream = New MemoryStream(My.Resources.es_ES)
                Me.Load(ms)
            End Using
        End Sub
    End Class

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 
     
    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  7. Guillermo
    Guillermo avatar
    4 posts
    Member since:
    Nov 2018

    Posted 17 Apr in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you very much. It works!.
Back to Top