[英]How to set the TRichedit default paragraph background color
I try to set the TRichEdit
control default paragraph bg color with this code: 我尝试使用以下代码设置
TRichEdit
控件的默认段落bg颜色:
//******************************************************************************
class procedure TRichEditUtility.setBGColor( aRE_ : TTNTRichEdit; bgColor_ : cardinal; default_ : boolean = FALSE );
//******************************************************************************
var
cf: TCharFormat2;
begin
if ( aRE_ <> NIL ) then
begin
fillchar(cf, sizeof(cf), 0);
cf.cbSize := sizeof( cf );
cf.dwMask := CFM_BACKCOLOR;
cf.crBackColor := bgColor_;
if ( default_ ) then
aRE_.Perform( EM_SETCHARFORMAT, SPF_SETDEFAULT, lparam(@cf) )
else
aRE_.Perform( EM_SETCHARFORMAT, SCF_SELECTION, lparam(@cf) );
end else
raise EInvalidInputParameter.create_string( 'TRichEditUtility', 'setBGColor', 'aRE_', CONST_chars_NIL );
end;
But the value of the SPF_SETDEFAULT
constant is unknown! 但是
SPF_SETDEFAULT
常数的值未知!
Can somebody tell me its value? 有人可以告诉我它的价值吗? (Or the file name which define its value)
(或定义其值的文件名)
Here is how to resolve this issue, and any issue of this nature. 这是解决此问题以及此类问题的方法。
SPF_SETDEFAULT
. SPF_SETDEFAULT
执行网络SPF_SETDEFAULT
。 EM_SETCHARFORMAT
. EM_SETCHARFORMAT
的文档。 Richedit.h
as the required header. Richedit.h
列为必需的标头。 Richedit.h
in your copy of the Windows SDK and search for SPF_SETDEFAULT
. Richedit.h
,然后搜索SPF_SETDEFAULT
。 #define SPF_SETDEFAULT 0x0004
. #define SPF_SETDEFAULT 0x0004
。 const SPF_SETDEFAULT = $0004
. const SPF_SETDEFAULT = $0004
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.