We use external component (MigraDoc) to compose an RTF document. Which then is converted to plain text by assigning RTF as string to System.Windows.Forms.RichTextBox's Rtf field and reading Text field. This has worked earlier but now we have found a problem (which has been there for a while already).
Plain text conversion is not working on Windows 10 but same application is working on Windows 7. After assigning Rft field, the Text field remains empty and also Rft field doesn't have the value which was just assigned. *
However, earlier version of our application is working on Windows 10 as well. Even there are no direct constitutive changes on this area. One possibly affecting change is .Net target version change from 4.0 to 4.7.2 (but it is hard to verify this anymore).
If I take the RTF string from Windows 7 and save it as file, it opens on WordPad on Windows 7. But it doesn't open on WordPad on Windows 10.
Have somebody else phased similar issues? Or are there any ideas how this could be fixed?
* But instead value:
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\f0\fs17\par
}
EDIT:
MigraDoc version is 1.32 i.e. the latest non-beta.
If you want to try out the
RICHEDIT20Wversion of RichEdit Control (Rich Text Edit Control v. 3.1), use a Custom Control built like this one. It tries to load theriched20.dlllibrary and, if it succeeds, it then sets the Class name of the Control in theCreateParamsoverride.You could also try to load the
RICHEDIT60Wversion that is usually shipped with MS Office installations, for testing. This version has also different behavior.In this case, you have to provide the full path of the library, which depends on the installed Office version and bitness
In practice, you have means to use a specific version of the Control.
Tweak this code to make it act as you prefer. As it is, it allows to switch between ver.
RICHEDIT20WandRICHEDIT50W(design-time or run-time)