Spell Check Uppercase Words and WordsWithNumbers

4 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 Merdjanov
    Admin
    Hristo Merdjanov avatar
    711 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. UI for WinForms is Visual Studio 2017 Ready
  4. Luis
    Luis avatar
    3 posts
    Member since:
    Jun 2015

    Posted 25 Jun 2015 in reply to Hristo Merdjanov 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.

     

     

  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    711 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
Back to Top