Tag: trichedit

在更改某些非文本字符的字体时,如何使TRichEdit在Windows 7上的行为类似于写字板?

在Sertac Akyuz的帮助下,似乎直接原因与\bullet的字符集有关:在我本地化的Windows中,通过键入Alt(0149)input的\bullet总是获得\fcharset134 ,并总是尝试通过EM_SETCHARFORMAT改变其字体不好(颜色,大小,风格确实可以改变,但不是字体名称)。 最简单的解决方法是首先重置字符集,然后更改字体。 注意:应该使用RichEdit (版本> = 4.1) ! 注意:RichEdit版本可以在MSDN 关于Rich Edit Controls ,Murray Sargent的MSDN博客RichEdit版本和RichEdit版本更新到7.0中find 。 后面的页面提到RichEdit版本高于4.1。 作为一个testing,我将Office 2010中的RICHED20.DLL与应用程序一起复制到Windows 2000,一切都像一个魅力! procedure TMainForm.ButtonFontClick(Sender: TObject); var format: TCharFormat2; begin if dlgFontCdxTxt.Execute then begin FillChar(format, sizeof(format), 0); format.cbSize:= Sizeof(format); format.dwMask:= CFM_CHARSET; format.bCharSet := 1; // or 0; redtTextBlock.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Integer(@format)); FillChar(format, sizeof(format), 0); format.cbSize:= Sizeof(format); format.dwMask:= CFM_FACE; StrPLCopy(format.szFaceName, […]