6

Issue: The built in Browser spellcheck does not work when I run my WPF C# application, though the spellcheck works when I load index.html file in Internet Explorer 11

index.html

<!-- saved from url=(0011)about:blank -->
<!DOCTYPE html>
<html lang="en" spellcheck="true">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=11">
    <script src="tinymce/tinymce.js" ></script>
  </head>
  <body>
    <textarea class="mceEditor form-control form-control-sm" id="myEditor" spellcheck="true" contenteditable="false" unselectable="on"></textarea>            
  </body>
  <script type="text/javascript">
    tinymce.init({
    theme: 'modern',
    browser_spellcheck: true,
    contextmenu: false,
    branding: false,
    selector: 'textarea',
    menubar: false,
    mode: "specific_textareas",
    editor_selector : "mceEditor",
    plugins: [
    'autolink lists link',
    'searchreplace visualblocks',
    'wordcount'
    ],
    toolbar: 'undo redo | bold italic underline | alignleft aligncenter | bullist numlist outdent indent | removeformat',
    });
  </script>
</html>

MainWindow.xaml

<WebBrowser Grid.Row="1" x:Name="wb" Navigated="wb_Navigated" />

MainWindow.xaml.cs

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DataContext = vm;
            Uri myUri;
            myUri = new Uri(AppDomain.CurrentDomain.BaseDirectory + @"Resources\index.html");
            wb.Navigate(myUri);
        }

        private void wb_Navigated(object sender, NavigationEventArgs e)
        {
            vm.document = (HTMLDocument)wb.Document;
        }
    }

index.html in WPF C# WebBrowser enter image description here

index.html in Internet Explorer 11 enter image description here

Required Solution: Mark "thisisatypo" in my WPF C# WebBrowser with red-underline, just like it appears in Internet Explorer 11. Let me know if you need any more details.

Meir Gabay
  • 2,870
  • 1
  • 24
  • 34
  • There's [a thread](https://social.msdn.microsoft.com/Forums/ie/en-US/20ad012b-a7a1-4b72-ad2b-aa9a22b87b00/enabling-the-ie-10-spell-checker-in-a-webbrowser?forum=ieextensiondevelopment) in which the Microsoft employee states that they are waiting on a fix. That was five years ago. I wouldn't hold your breath. – Dan Wilson Jul 08 '18 at 11:33
  • Already saw that thread, I thought someone might have a creative solution for this one :\ I thought of another solution, though I'm not sure how to implement - onkeypress, send word to WPF App, check if there are spelling mistakes and send back to WebBrowser, but I don't know how to mark "mistakes" in the WebBrowser – Meir Gabay Jul 08 '18 at 12:06
  • Actually, in IE11 it only begin to underline if you edit something. Otherwise, if you just load a text with a misspelled word but don't edit anything, there is no underlining. Is that the behavior you want? – noseratio Jul 09 '18 at 05:49
  • Yes, I only need to know if there are any spelling issues for html Textarea element. Do you have a solution that can work in a WPF app? – Meir Gabay Jul 09 '18 at 21:07
  • some luck with enabling more features of the browser control: http://stackoverflow.com/a/18333982/1768303 ? – ralf.w. Jul 14 '18 at 16:07
  • Thanks for the reference, I'll check it out! – Meir Gabay Jul 15 '18 at 09:27

1 Answers1

-1

You need to do Registry entry for FEATURE_SPELLCHECK

It allowed spelling checking in TinyMCE to work in our embedded web browser control.

Check this Reference

This One Also

And Same Question In stack OverFlow

Hitesh Anshani
  • 1,499
  • 9
  • 19
  • Hi, already saw those references. I can't consider your answer as a solution since there's no practical example on how to solve the issue. – Meir Gabay Jul 22 '18 at 12:34
  • Sorry but I didn't understand what you commented – Meir Gabay Jul 30 '18 at 09:54
  • so ask for more Explanation @MeirGabay refer this https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330735(v=vs.85)#spellchecking – Hitesh Anshani Jul 30 '18 at 10:25