基本上,我使用NHunspell来检查拼写错误,我遇到了一个错误和问题。
它就会崩溃。为了避免这个错误,我必须简单地锁定表单并禁用最大化按钮。这样,用户就可以关闭程序并调整其大小。
错误:
`System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at NHunspellExtender.NHunspellTextBoxExtender.CustomPaintTextBox.TextBoxBase_ClientSizeChanged(Object sender, EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)`另一个问题是似乎存在性能问题。如果我加载一个包含大约500+字符的文件,有相当多的错误,假设有25个,并且我试图向下滚动页面,它会变得相当滞后。
PS。这个问题只有在我使用RichTextBoxes时才会发生。TextBoxes很好。
发布于 2014-11-20 08:07:08
一种更简单的解决方法是使用WPF RichTextBox。它附带了一个默认的拼写检查,我现在在WinForms中使用它。我通过使用WinForms的主机元素完成了这项工作。尽管TUTORIAL使用DataGrid,但很容易将其更改为您想要的任何控件。
然而,我仍然想知道一个解决方案。
https://stackoverflow.com/questions/27010020
复制相似问题