问题:运行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中
Internet Explorer 11中的
必需的解决方案:在我的WPF C#WebBrowser中用红色下划线标记“ thisisatypo”,就像Internet Explorer 11中显示的那样。请告知我是否需要更多详细信息。
答案 0 :(得分:0)
您需要为FEATURE_SPELLCHECK做注册表项
它允许TinyMCE中的拼写检查在我们的嵌入式Web浏览器控件中起作用。