WebBrowser-Control中的TinyMCE TextArea的浏览器拼写检查-WPF C#

时间:2018-07-08 11:11:58

标签: c# wpf webbrowser-control spell-checking

问题:运行WPF C#应用程序时,内置浏览器拼写检查不起作用,尽管在Internet Explorer 11中加载 index.html 文件时,拼写检查也有效

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;
        }
    }
在WPF C#WebBrowser中

index.html enter image description here

Internet Explorer 11中的

index.html enter image description here

必需的解决方案:在我的WPF C#WebBrowser中用红色下划线标记“ thisisatypo”,就像Internet Explorer 11中显示的那样。请告知我是否需要更多详细信息。

1 个答案:

答案 0 :(得分:0)

您需要为FEATURE_SPELLCHECK做注册表项

它允许TinyMCE中的拼写检查在我们的嵌入式Web浏览器控件中起作用。

Check this Reference

This One Also

And Same Question In stack OverFlow