Why isn't the richtextbox displaying this table properly?
I found the solution. Evidently, there are more than one RichEdit library on every system, and the default to an older version (4.0 I think). 5.0 has fixed most of the problems with the RTF interpretation. To get a RichtextBox that uses it, you must inert RichTextBox, and overload the CreateParams property.
Here is how I did it:
public partial class FullRichtextBox : RichTextBox {
public FullRichtextBox() :base() {
InitializeComponent();
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
static extern IntPtr LoadLibrary(string lpFileName);
protected override CreateParams CreateParams {
get {
CreateParams param = base.CreateParams;
if (LoadLibrary("msftedit.dll") != IntPtr.Zero) {
param.ClassName = "RICHEDIT50W";
}
return param;
}
}
}