procedure ZsRichEditAppend(mRichEdit: TRichEdit; mText: string; mFont: TFont); { 添加一个RTF字符串 } var I, L: Integer; vText: string; begin vText := mRichEdit.Lines.Text; I := Length(vText); L := 0; while (I > 0) and (L < 2) and (vText[I] in [#13, #10]) do begin Inc(L); Dec(I); end; mRichEdit.SelStart := I; mRichEdit.SelLength := L; mRichEdit.SelAttributes.Assign(mFont); mRichEdit.SelText := mText; end; { ZsRichEditAppend }
{ 添加一个RTF字符串 }
var
I, L: Integer;
vText: string;
begin
vText := mRichEdit.Lines.Text;
I := Length(vText);
L := 0;
while (I > 0) and (L < 2) and (vText[I] in [#13, #10]) do begin
Inc(L);
Dec(I);
end; mRichEdit.SelStart := I;
mRichEdit.SelLength := L;
mRichEdit.SelAttributes.Assign(mFont);
mRichEdit.SelText := mText;
end; { ZsRichEditAppend }
RichEdit1.SelAttributes.Name := '宋体';
RichEdit1.SelAttributes.Size := 9;
RichEdit1.SelAttributes.Style :=RichEdit.SelAttributes.Style+[fsBold] + [fsItatic];
还是我没说清楚?
我要做一个语法制导的Editor,现在的问题是:
不论我要改变还是判断一个字符串的字体属性,我都要先选中他,改完后再取消选定,这样屏幕上就会闪一下,我想知道怎样解决。当然若能先把选中色改为背景色也可避免这一问题。
还是我没说清楚?
我要做一个语法制导的Editor,现在的问题是:
不论我要改变还是判断一个字符串的字体属性,我都要先选中他,改完后再取消选定,这样屏幕上就会闪一下,我想知道怎样解决。当然若能先把选中色改为背景色也可避免这一问题。