如何使用 RichEditViewer 在 Inno Setup 的自定义页面中添加可点击的链接?
How to add clickable links to custom page in Inno Setup using RichEditViewer?
如何在 Inno Setup 中添加可点击的 link 到 RichEditViewer
?我尝试了这个解决方案
使用下面的代码:
[Code]
var
Page: TWizardPage;
procedure CreateTheWizardPages;
var
RichViewer1 : TRichEditViewer;
begin
Page := CreateCustomPage(wpReady, 'Custom', 'Page');
RichViewer1 := TRichEditViewer.Create(Page);
RichViewer1.Left := 0;
RichViewer1.Top := 30;
RichViewer1.width:=400;
RichViewer1.WordWrap := True;
RichViewer1.BorderStyle := bsNone;
RichViewer1.TabStop := False;
RichViewer1.ReadOnly := True;
RichViewer1.Parent := Page.Surface;
RichViewer1.ParentColor := true;
RichViewer1.RTFText := '{\rtf1 ' +
'{\colortbl ;\red238\green0\blue0;}' +
'Lorem ipsum dolor sit amet ' +
'{\b {\field{\*\fldinst{HYPERLINK "https://www.example.com/" }}' +
'{\fldrslt{\cf1 CLICK_HERE\cf0 }}}} ' +
'consectetur adipiscing elit.}';
end;
procedure InitializeWizard();
begin
CreateTheWizardPages;
end;
我在自定义页面上得到了这样的东西:
我想要一个可点击的 link "CLICK_HERE"
我正在使用 Inno Setup 5.6.1,Windows 10 Pro 1909。
我已经针对各种版本的 Inno Setup 编译器测试了代码。
貌似在Ansi版本中不起作用。它适用于 Unicode 版本。 Unicode 版本是使用较新版本的 Delphi 构建的,这可能是原因。
无论如何你都应该。一旦你这样做了,你应该升级到最新版本的 Inno Setup(只有 Unicode 版本)。
如何在 Inno Setup 中添加可点击的 link 到 RichEditViewer
?我尝试了这个解决方案
使用下面的代码:
[Code]
var
Page: TWizardPage;
procedure CreateTheWizardPages;
var
RichViewer1 : TRichEditViewer;
begin
Page := CreateCustomPage(wpReady, 'Custom', 'Page');
RichViewer1 := TRichEditViewer.Create(Page);
RichViewer1.Left := 0;
RichViewer1.Top := 30;
RichViewer1.width:=400;
RichViewer1.WordWrap := True;
RichViewer1.BorderStyle := bsNone;
RichViewer1.TabStop := False;
RichViewer1.ReadOnly := True;
RichViewer1.Parent := Page.Surface;
RichViewer1.ParentColor := true;
RichViewer1.RTFText := '{\rtf1 ' +
'{\colortbl ;\red238\green0\blue0;}' +
'Lorem ipsum dolor sit amet ' +
'{\b {\field{\*\fldinst{HYPERLINK "https://www.example.com/" }}' +
'{\fldrslt{\cf1 CLICK_HERE\cf0 }}}} ' +
'consectetur adipiscing elit.}';
end;
procedure InitializeWizard();
begin
CreateTheWizardPages;
end;
我在自定义页面上得到了这样的东西:
我想要一个可点击的 link "CLICK_HERE"
我正在使用 Inno Setup 5.6.1,Windows 10 Pro 1909。
我已经针对各种版本的 Inno Setup 编译器测试了代码。
貌似在Ansi版本中不起作用。它适用于 Unicode 版本。 Unicode 版本是使用较新版本的 Delphi 构建的,这可能是原因。
无论如何你都应该