

























uses Winapi.RichEdit;
procedure RE_SetSelBgColor(RichEdit: TRichEdit; AColor: TColor); var Format: CHARFORMAT2; begin FillChar(Format, SizeOf(Format), 0); with Format do begin cbSize := SizeOf(Format); dwMask := CFM_BACKCOLOR; crBackColor := AColor; Richedit.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(@Format)); end; end; procedure TMainForm.ToolButton14Click(Sender: TObject); begin RE_SetSelBgColor(editor, clYellow); //设置 文字 背景色 editor.SelLength:=0; end;

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。