2
我有汉斯帕桑特做出这种控制,我从这里(Trying to use the C# SpellCheck class)抓住和修改,以加载额外的词典:为什么拼写检查总是将附加字典中的单词(utf-8,带有BOM,UTF-16的utf-8)标记为坏?
using System;
using System.Windows;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Forms.Integration;
namespace SoAL_TextExtractor
{
class SpellBox : ElementHost
{
public SpellBox()
{
box = new TextBox();
base.Child = box;
box.TextChanged += (s, e) => OnTextChanged(EventArgs.Empty);
Uri lex_file = new Uri(System.Windows.Forms.Application.StartupPath + "\\Russian.lex");
box.SpellCheck.CustomDictionaries.Add(lex_file);
box.SpellCheck.IsEnabled = true;
box.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
this.Size = new System.Drawing.Size(100, 20);
}
public override string Text
{
get { return box.Text; }
set { box.Text = value; }
}
[DefaultValue(false)]
public bool Multiline
{
get { return box.AcceptsReturn; }
set { box.AcceptsReturn = value; }
}
[DefaultValue(false)]
public bool WordWrap
{
get { return box.TextWrapping != TextWrapping.NoWrap; }
set { box.TextWrapping = value ? TextWrapping.Wrap : TextWrapping.NoWrap; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new System.Windows.UIElement Child
{
get { return base.Child; }
set { /* Do nothing to solve a problem with the serializer !! */ }
}
private TextBox box;
}
}
这本字典:
而且,这结果:
我对* .lex尝试了不同的编码,但仍标记为不良。
有法盖子,需要:
#LID 1049
абажур
абажура
...
这是怎么回事?
你不能只是复制别人的代码,并重新发布它,就好像它是你自己的。要求归因,请查看页面底部的详细信息。 – 2014-09-04 09:52:15
@HansPassant - 对不起?我在哪里说过这是我的代码?我所说的只是“我有这个控制权”。我知道这是从另一个答案抓住,但我从来没有告诉过,这是我的。我使用它,我遇到了问题,并且在这里展示了我的所有内容。 – Kosmos 2014-09-04 13:42:41
该许可证没有说任何关于这一点。这是一个非常简单的规则,当你转发别人的工作时,你必须**属性。总是。请照顾好它。 – 2014-09-04 14:11:15