about insert link
Posted: Fri Nov 18, 2005 2:03 pm
In my program , I insert link text using code under:
But after do it, all text's format is link now.
How can I restore the format before I insert link?
Thanks.
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.