Inno Setup - 如何更改 RTF 文本中超链接的颜色? [英] Inno Setup - How to change the color of the hyperlink in RTF text?

查看:27
本文介绍了Inno Setup - 如何更改 RTF 文本中超链接的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用来自

我如何使用语法来更改 RTF 中更改超链接颜色的

I'm using code from How to add clickable links to custom Inno Setup WelcomeLabel?:

procedure InitializeWizard;
var
  RichViewer: TRichEditViewer;
begin
  RichViewer := TRichEditViewer.Create(WizardForm);
  RichViewer.Left := WizardForm.WelcomeLabel2.Left;
  RichViewer.Top := WizardForm.WelcomeLabel2.Top;
  RichViewer.Width := WizardForm.WelcomeLabel2.Width;
  RichViewer.Height := WizardForm.WelcomeLabel2.Height;
  RichViewer.Parent := WizardForm.WelcomeLabel2.Parent;
  RichViewer.BorderStyle := bsNone;
  RichViewer.TabStop := False;
  RichViewer.ReadOnly := True;
  WizardForm.WelcomeLabel2.Visible := False;

  RichViewer.RTFText :=
    '{
tf1 Lorem ipsum dolor sit amet ' +
    '{ {field{*fldinst{HYPERLINK "https://www.example.com/" }}' +
    '{fldrslt{CLICK_HERE}}}} ' +
    'consectetur adipiscing elit.}';
end;

And I want to change the color of the hyperlink to blue:

How do I use a syntax for changing changing hyperlink color in RTF from the answer by Oliver Bock to What is the RTF syntax for a hyperlink? with the above code?

{colortbl ;
ed0green0lue238;}
{field{*fldinst HYPERLINK "URL"}{fldrslt{ulcf1Text to display}}}

解决方案

Indeed, on Windows 7, the link color is not blue by default (it is on Windows 10).

The correct RTF syntax to force a certain link color is like:

RichViewer.RTFText :=
  '{
tf1 ' +
  '{colortbl ;
ed238green0lue0;}' +
  'Lorem ipsum dolor sit amet ' +
  '{ {field{*fldinst{HYPERLINK "https://www.example.com/" }}' + 
  '{fldrslt{cf1 CLICK_HEREcf0 }}}} ' +
  'consectetur adipiscing elit.}';

这篇关于Inno Setup - 如何更改 RTF 文本中超链接的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆