Home > Back-end > By sending a message to set up the mechanism of rich text box font style color and size
By sending a message to set up the mechanism of rich text box font style color and size
Time:09-15
SendMessage (H, EM_SETCHARFORMAT,? ,?) ;
Or
SendMessage (H, WM_SETFONT,? ,?) ;
CodePudding user response:
Should not through the message mechanism to style to set the Font color and size, because if the Font color and size changes, the system USES the message mechanism to change, according to the direct effect of or the original Font,
This is the system in the source code:
Procedure WMSetFont (var Message: TWMSetFont); The message WM_SETFONT;
Procedure TCustomRichEdit. WMSetFont (var Message: TWMSetFont); The begin FDefAttributes. Assign (Font); The end;