Hyperlink Underline Color

General TRichView support forum. Please post your questions here
Post Reply
standay
Posts: 324
Joined: Fri Jun 18, 2021 3:07 pm

Hyperlink Underline Color

Post by standay »

Sergey,

Using styletemplates, I was able to get the hyperlink text color to change using this:

Code: Select all

    i := RVEFilervActionNew1.StyleTemplates.FindByName(RVHYPERLINKSTYLETEMPLATENAME);
    RVEFilervActionNew1.StyleTemplates[i].ValidTextPropertiesEditor :=
      '[rvfiUnderline,rvfiColor,rvfiJump,rvfiUnderlineColor]';
    RVEFilervActionNew1.StyleTemplates[i].TextStyle.Color := clWindowText;
    RVEFilervActionNew1.StyleTemplates[i].TextStyle.UnderlineColor := clAqua;
    rve.Style.StyleTemplates := RVEFilervActionNew1.StyleTemplates;
    rve.RVData.DoStyleTemplatesChange;
But no matter what I do, I can't get the underline color to change. Can you tell me how to do that?

Thanks

Stan
standay
Posts: 324
Joined: Fri Jun 18, 2021 3:07 pm

Re: Hyperlink Underline Color

Post by standay »

For now, I put the code below into the RVStyle1ApplyStyle procedure:

Code: Select all

  //Overrides hyperlink styletemplate:
  for i := 1 to rve.Style.TextStyles.Count-1 do
  begin
    if rve.Style.TextStyles[i].Jump then
    begin
      //rve.Style.TextStyles[i].FontName := rve.Style.TextStyles[0].FontName;
      //rve.Style.TextStyles[i].Size := rve.Style.TextStyles[0].Size;
      rve.Style.TextStyles[i].Color := rve.Style.TextStyles[0].Color;
      rve.Style.TextStyles[i].UnderlineColor := clAqua;
    end;
  end;
That works to "force" the hyperlink text colors to be what I want them to be. But sure seems that this:

Code: Select all

    RVEFilervActionNew1.StyleTemplates[i].TextStyle.UnderlineColor := clAqua;
Should work...

Stan
Post Reply