Code: Select all
f:=TfrmInsertLink.Create(self);
url:=pchar(aRVE.GetCurrentTag);
if url='' then url:='http://';
f.edtTarget.Text:=url;
if f.ShowModal=mrok then
begin
FontInfo:=TFontInfo.Create(nil);
try
FontInfo.Assign(rvs.TextStyles[4]);
FontInfo.Color:=f.lblCommonText.Color;
FontInfo.BackColor:=f.lblCommonBack.Color;
FontInfo.HoverColor:=f.lblActiveText.Color;
FontInfo.HoverBackColor:=f.lblActiveBack.Color;
rvs.TextStyles.Add;
rvs.TextStyles[rvs.TextStyles.Count-1].Assign(FontInfo);
rvs.TextStyles[rvs.TextStyles.Count-1].Standard:=false;
aRVE.applyTextStyle(rvs.TextStyles.Count-1);
url:=f.edtTarget.Text;
SetUrlToSelection(url);
FontInfo.Free;
except
end;
end;
How can I restore the format before I insert link?
Thanks.